diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-03-22 19:17:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-22 19:17:23 -0400 |
commit | 5e3ddf628397b8f3e88d7c3114d060e06289ac4c (patch) | |
tree | 16cccfe095433b37e12c26094b130f0355fd9f42 /railties/lib | |
parent | 0709b60fbe2e9eff8b9d07b5c0d4b60f4660f968 (diff) | |
parent | d0accc23b3d01a7d35e73c5dc901014d883ef5f7 (diff) | |
download | rails-5e3ddf628397b8f3e88d7c3114d060e06289ac4c.tar.gz rails-5e3ddf628397b8f3e88d7c3114d060e06289ac4c.tar.bz2 rails-5e3ddf628397b8f3e88d7c3114d060e06289ac4c.zip |
Merge pull request #28513 from maclover7/jm-fix-28500
CLI arg "host" has precedence over ENV var "host"
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/commands/server/server_command.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 7e8c86fb49..278fe63c51 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -188,10 +188,12 @@ module Rails end def host - unless (default_host = options[:binding]) + if options[:binding] + options[:binding] + else default_host = environment == "development" ? "localhost" : "0.0.0.0" + ENV.fetch("HOST", default_host) end - ENV.fetch("HOST", default_host) end def environment |