diff options
-rw-r--r-- | railties/lib/rails/commands/server/server_command.rb | 2 | ||||
-rw-r--r-- | railties/test/commands/server_test.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 44b26d3846..64fb912b51 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -70,7 +70,7 @@ module Rails end def served_url - "#{options[:SSLEnable] ? 'https' : 'http'}://#{host}:#{port}" unless use_puma? + "#{options[:SSLEnable] ? 'https' : 'http'}://#{options[:Host]}:#{options[:Port]}" unless use_puma? end private diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb index c84be439e4..467afe7cea 100644 --- a/railties/test/commands/server_test.rb +++ b/railties/test/commands/server_test.rb @@ -239,6 +239,12 @@ class Rails::Command::ServerCommandTest < ActiveSupport::TestCase ARGV.replace original_args end + def test_served_url + args = %w(-u webrick -b 127.0.0.1 -p 4567) + server = Rails::Server.new(parse_arguments(args)) + assert_equal "http://127.0.0.1:4567", server.served_url + end + private def run_command(*args) build_app |