]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
detection of aqua layout scheme added
[wxWidgets.git] / src / common / http.cpp
index 8471c3392646dbc820b88446f72a75b0ddf436ae..bda7c28d0032749d5c33ba8d0ea31f15d5c32f24 100644 (file)
@@ -20,7 +20,7 @@
   #pragma hdrstop
 #endif
 
-#if wxUSE_SOCKETS && wxUSE_STREAMS
+#if wxUSE_PROTOCOL_HTTP
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -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;
 }
 
@@ -337,5 +343,5 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path)
   return inp_stream;
 }
 
-#endif
-   // wxUSE_SOCKETS
+#endif // wxUSE_PROTOCOL_HTTP
+