]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
Don't define wxArrayPGProperty as std::vector in STL build.
[wxWidgets.git] / src / common / http.cpp
index f6a644fda7bd9cfe766d973f07210753048bec31..145ec61f3c8e2ae950ae924cf8524f5629162b60 100644 (file)
@@ -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;