summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-12-04 08:04:52 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-12-04 08:04:52 (GMT)
commit33c379ef63279833c49919fd619668b19b138f3b (patch)
tree3ce9f6ecebbf49602e9eda862413847d59eca686
parentc06c4d264aca4e252495181a8de01960abad983f (diff)
downloadswift-contrib-33c379ef63279833c49919fd619668b19b138f3b.zip
swift-contrib-33c379ef63279833c49919fd619668b19b138f3b.tar.bz2
Remove double // and :1 port from BOSH paths
Change-Id: Iff89e5a01565676295f634ee92760854c4872e6d Resolves: #1187
-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"