include port number in HTTP Host header (closes #10632)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -325,6 +325,10 @@ Major new features in this release
|
||||
|
||||
All:
|
||||
|
||||
- Include port number in host header in wxHTTP (Marcin 'Malcom' Malich).
|
||||
|
||||
All (GUI):
|
||||
|
||||
- wxHTML: add support for table borders width (Laurent Humbertclaude).
|
||||
|
||||
i18n:
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user