summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/BOSHConnection.cpp')
-rw-r--r--Swiften/Network/BOSHConnection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp
index 4741549..539109a 100644
--- a/Swiften/Network/BOSHConnection.cpp
+++ b/Swiften/Network/BOSHConnection.cpp
@@ -161,8 +161,12 @@ void BOSHConnection::startStream(const std::string& to, unsigned long long rid)
std::string contentString = content.str();
- header << "POST /" << boshURL_.getPath() << " HTTP/1.1\r\n"
- << "Host: " << boshURL_.getHost() << ":" << boshURL_.getPort() << "\r\n"
+ header << "POST " << boshURL_.getPath() << " HTTP/1.1\r\n"
+ << "Host: " << boshURL_.getHost();
+ if (boshURL_.getPort()) {
+ header << ":" << *boshURL_.getPort();
+ }
+ header << "\r\n"
/*<< "Accept-Encoding: deflate\r\n"*/
<< "Content-Type: text/xml; charset=utf-8\r\n"
<< "Content-Length: " << contentString.size() << "\r\n\r\n"