You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you provide a Host header entry, set_request_header will ignore it and assume that the hostname in the URI is the correct one. This is normally a good assumption, except when you are accessing a virtualhost without going through DNS.
This simple change fixes it:
def set_request_header
return if @dumped
@dumped = true
keep_alive = Message.keep_alive_enabled?(@http_version)
if !keep_alive and @request_method != 'CONNECT'
set('Connection', 'close')
end
if @chunked
set('Transfer-Encoding', 'chunked')
elsif @body_size and (keep_alive or @body_size != 0)
set('Content-Length', @body_size.to_s)
end
if @http_version >= 1.1
if (h = get('Host')).length > 0
host = h.flatten.last
else
host = @request_uri.host
end
if @request_uri.port == @request_uri.default_port
# GFE/1.3 dislikes default port number (returns 404)
set('Host', "#{host}")
else
set('Host', "#{host}:#{@request_uri.port}")
end
end
end
The text was updated successfully, but these errors were encountered:
If you provide a Host header entry, set_request_header will ignore it and assume that the hostname in the URI is the correct one. This is normally a good assumption, except when you are accessing a virtualhost without going through DNS.
This simple change fixes it:
The text was updated successfully, but these errors were encountered: