Fix so the Host: header in wxHTTP really works. With virtual hosts it
is vital that the original host name given in the URL is used in the Host: header so the sever will use the right vhost config. Previously it was using the value returned from gethostbyaddr which will often not be the same as the hostname in the URL. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14332 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -181,7 +181,7 @@ bool wxHTTP::Connect(const wxString& host)
|
||||
|
||||
if (!addr->Service(wxT("http")))
|
||||
addr->Service(80);
|
||||
|
||||
|
||||
SetHeader(wxT("Host"), host);
|
||||
|
||||
return TRUE;
|
||||
@@ -198,7 +198,7 @@ bool wxHTTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait))
|
||||
|
||||
wxIPV4address *ipv4addr = wxDynamicCast(&addr, wxIPV4address);
|
||||
if (ipv4addr)
|
||||
SetHeader(wxT("Host"), ipv4addr->Hostname());
|
||||
SetHeader(wxT("Host"), ipv4addr->OrigHostname());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user