X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0c133e13b36a923c65f94499554e432bc3a0daa..29a35dd5fee0e33143a39824e71aefd66e3e4851:/src/common/http.cpp?ds=sidebyside diff --git a/src/common/http.cpp b/src/common/http.cpp index f6a644fda7..145ec61f3c 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -219,7 +219,10 @@ bool wxHTTP::Connect(const wxString& host, unsigned short port) else if (!addr->Service(wxT("http"))) addr->Service(80); - SetHeader(wxT("Host"), host); + wxString hostHdr = host; + if ( port && port != 80 ) + hostHdr << wxT(":") << port; + SetHeader(wxT("Host"), hostHdr); m_lastError = wxPROTO_NOERR; return true; @@ -235,8 +238,14 @@ bool wxHTTP::Connect(const wxSockAddress& addr, bool WXUNUSED(wait)) m_addr = addr.Clone(); wxIPV4address *ipv4addr = wxDynamicCast(&addr, wxIPV4address); - if (ipv4addr) - SetHeader(wxT("Host"), ipv4addr->OrigHostname()); + if ( ipv4addr ) + { + wxString hostHdr = ipv4addr->OrigHostname(); + unsigned short port = ipv4addr->Service(); + if ( port && port != 80 ) + hostHdr << wxT(":") << port; + SetHeader(wxT("Host"), hostHdr); + } m_lastError = wxPROTO_NOERR; return true;