diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-12-04 08:04:52 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-12-04 08:04:52 (GMT) |
commit | 33c379ef63279833c49919fd619668b19b138f3b (patch) | |
tree | 3ce9f6ecebbf49602e9eda862413847d59eca686 /Swiften | |
parent | c06c4d264aca4e252495181a8de01960abad983f (diff) | |
download | swift-contrib-33c379ef63279833c49919fd619668b19b138f3b.zip swift-contrib-33c379ef63279833c49919fd619668b19b138f3b.tar.bz2 |
Remove double // and :1 port from BOSH paths
Change-Id: Iff89e5a01565676295f634ee92760854c4872e6d
Resolves: #1187
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Network/BOSHConnection.cpp | 8 |
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" |