mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
port is appended twice to HTTP_HOST when host already has the port
This commit is contained in:
parent
14d2feeeab
commit
29f13beda3
1 changed files with 3 additions and 3 deletions
|
@ -257,19 +257,19 @@ module ActionDispatch
|
|||
end
|
||||
end
|
||||
|
||||
port = host.split(':')[1]
|
||||
hostname, port = host.split(':')
|
||||
|
||||
env = {
|
||||
:method => method,
|
||||
:params => parameters,
|
||||
|
||||
"SERVER_NAME" => host.split(':')[0],
|
||||
"SERVER_NAME" => hostname,
|
||||
"SERVER_PORT" => (port ? port : (https? ? "443" : "80")),
|
||||
"HTTPS" => https? ? "on" : "off",
|
||||
"rack.url_scheme" => https? ? "https" : "http",
|
||||
|
||||
"REQUEST_URI" => path,
|
||||
"HTTP_HOST" => [host, port].compact.join(':'),
|
||||
"HTTP_HOST" => host,
|
||||
"REMOTE_ADDR" => remote_addr,
|
||||
"CONTENT_TYPE" => "application/x-www-form-urlencoded",
|
||||
"HTTP_ACCEPT" => accept
|
||||
|
|
Loading…
Reference in a new issue