1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated support for using the HOST environment variable to specify the server IP

This commit is contained in:
Rafael Mendonça França 2020-10-29 20:41:13 +00:00
parent 5a7028a1a5
commit c0728ad321
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
4 changed files with 6 additions and 18 deletions

View file

@ -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

View file

@ -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*

View file

@ -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

View file

@ -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