From 33c379ef63279833c49919fd619668b19b138f3b Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Tue, 4 Dec 2012 08:04:52 +0000 Subject: Remove double // and :1 port from BOSH paths Change-Id: Iff89e5a01565676295f634ee92760854c4872e6d Resolves: #1187 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" -- cgit v0.10.2-6-g49f6