diff --git a/modules/juce_core/native/juce_linux_Network.cpp b/modules/juce_core/native/juce_linux_Network.cpp index da0649fbd5..61553bdd9d 100644 --- a/modules/juce_core/native/juce_linux_Network.cpp +++ b/modules/juce_core/native/juce_linux_Network.cpp @@ -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,