send Host header in HTTP requests
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3f2eabd59d
commit
5b96a71a56
@ -177,6 +177,8 @@ bool wxHTTP::Connect(const wxString& host)
|
||||
|
||||
if (!addr->Service(wxT("http")))
|
||||
addr->Service(80);
|
||||
|
||||
SetHeader(wxT("Host"), host);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -190,6 +192,10 @@ bool wxHTTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait))
|
||||
|
||||
m_addr = addr.Clone();
|
||||
|
||||
wxIPV4address *ipv4addr = wxDynamicCast(&addr, wxIPV4address);
|
||||
if (ipv4addr)
|
||||
SetHeader(wxT("Host"), ipv4addr->Hostname());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user