]> git.saurik.com Git - wxWidgets.git/commitdiff
send Host header in HTTP requests
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 18 Dec 2001 23:12:52 +0000 (23:12 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 18 Dec 2001 23:12:52 +0000 (23:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/http.cpp

index 8471c3392646dbc820b88446f72a75b0ddf436ae..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;
 }
@@ -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;
 }