diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-12-28 17:05:12 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-28 17:07:13 +0000 |
commit | fec0ea9d6d4ca56a09e3e83002c38d69c8ad924e (patch) | |
tree | f8048acb56e43fb58d1762ac678aa6048b06b5c0 /actionpack/lib | |
parent | c0c79f779c990f9e53c9b600291801fdf0bbe56b (diff) | |
download | rails-fec0ea9d6d4ca56a09e3e83002c38d69c8ad924e.tar.gz rails-fec0ea9d6d4ca56a09e3e83002c38d69c8ad924e.tar.bz2 rails-fec0ea9d6d4ca56a09e3e83002c38d69c8ad924e.zip |
Request#env['SERVER_NAME'] does not contain port number
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 8a02130d88..3390324162 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -286,7 +286,7 @@ EOM if forwarded = env["HTTP_X_FORWARDED_HOST"] forwarded.split(/,\s?/).last else - env['HTTP_HOST'] || env['SERVER_NAME'] || "#{env['SERVER_ADDR']}:#{env['SERVER_PORT']}" + env['HTTP_HOST'] || "#{env['SERVER_NAME'] || env['SERVER_ADDR']}:#{env['SERVER_PORT']}" end end diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index acfb10cdca..285a8b09e4 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -33,11 +33,7 @@ module ActionController #:nodoc: attr_accessor :host def initialize - env = Rack::MockRequest.env_for("/") - - # TODO: Fix Request to assume env['SERVER_ADDR'] doesn't contain port number - env['SERVER_ADDR'] = env.delete("SERVER_NAME") - super(env) + super(Rack::MockRequest.env_for("/")) @query_parameters = {} @session = TestSession.new |