1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Include port number in http request header if it is a non-standard port number (see HTTP spec 14.23)

This commit is contained in:
hogliux 2015-06-25 16:14:29 +01:00
parent 9efbd199a6
commit 67436307bf

View file

@ -343,9 +343,13 @@ private:
}
static void writeHost (MemoryOutputStream& dest, const bool isPost,
const String& path, const String& host, int /*port*/)
const String& path, const String& host, int port)
{
dest << (isPost ? "POST " : "GET ") << path << " HTTP/1.0\r\nHost: " << host;
/* HTTP spec 14.23 says that the port number must be included in the header if it is not 80 */
if (port != 80)
dest << ':' << port;
}
static MemoryBlock createRequestHeader (const String& hostName, const int hostPort,