From c0728ad3213d1e582871860e37c131b503372b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 29 Oct 2020 20:41:13 +0000 Subject: [PATCH] Remove deprecated support for using the `HOST` environment variable to specify the server IP --- guides/source/6_1_release_notes.md | 2 ++ railties/CHANGELOG.md | 4 ++++ railties/lib/rails/commands/server/server_command.rb | 9 --------- railties/test/commands/server_test.rb | 9 --------- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index 5b31dbb124..1da89891e7 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -41,6 +41,8 @@ Please refer to the [Changelog][railties] for detailed changes. * Remove deprecated `server` argument from the rails server command. +* Remove deprecated support for using the `HOST` environment variable to specify the server IP. + ### Deprecations ### Notable changes diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 954a3760b2..01c21602db 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated support for using the `HOST` environment variable to specify the server IP. + + *Rafael Mendonça França* + * Remove deprecated `server` argument from the rails server command. *Rafael Mendonça França* diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 16a516ffc4..3a48524c1b 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -220,15 +220,6 @@ module Rails else default_host = environment == "development" ? "localhost" : "0.0.0.0" - if ENV["HOST"] && !ENV["BINDING"] - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Using the `HOST` environment variable to specify the IP is deprecated and will be removed in Rails 6.1. - Please use `BINDING` environment variable instead. - MSG - - return ENV["HOST"] - end - ENV.fetch("BINDING", default_host) end end diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb index 61f2169fcc..ad00243385 100644 --- a/railties/test/commands/server_test.rb +++ b/railties/test/commands/server_test.rb @@ -96,15 +96,6 @@ class Rails::Command::ServerCommandTest < ActiveSupport::TestCase end end - def test_environment_with_host - switch_env "HOST", "1.2.3.4" do - assert_deprecated do - options = parse_arguments - assert_equal "1.2.3.4", options[:Host] - end - end - end - def test_environment_with_binding switch_env "BINDING", "1.2.3.4" do options = parse_arguments