X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02244615e5bd44e22d2b338c94c610c9ad046de2..88594d02eb59a55ac85d3210a49d02918124617b:/src/common/http.cpp diff --git a/src/common/http.cpp b/src/common/http.cpp index 4bcfd76870..c4d821cf85 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -177,6 +177,8 @@ bool wxHTTP::Connect(const wxString& host) if (!addr->Service(wxT("http"))) addr->Service(80); + + SetHeader(wxT("Host"), host); return TRUE; } @@ -185,11 +187,15 @@ bool wxHTTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait)) { if (m_addr) { delete m_addr; - m_addr = NULL; Close(); } - m_addr = (wxSockAddress *) addr.Clone(); + m_addr = addr.Clone(); + + wxIPV4address *ipv4addr = wxDynamicCast(&addr, wxIPV4address); + if (ipv4addr) + SetHeader(wxT("Host"), ipv4addr->Hostname()); + return TRUE; }