]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
Added missing header and missing logic. :)
[wxWidgets.git] / src / common / http.cpp
index 4bcfd768704fc7616f11407c44eec2e315960f6c..c4d821cf859acae53b38bc6ff626ca4acc129a3e 100644 (file)
@@ -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;
 }