diff -U 3 -H -d -r -N -- kmess-2.0.6.1/src/network/soap/httpsoapconnection.cpp kmess-2.0.6.1-alex1/src/network/soap/httpsoapconnection.cpp --- kmess-2.0.6.1/src/network/soap/httpsoapconnection.cpp 2011-02-16 08:16:45.000000000 +0100 +++ kmess-2.0.6.1-alex1/src/network/soap/httpsoapconnection.cpp 2011-11-10 07:47:36.407929345 +0100 @@ -456,6 +456,7 @@ const QByteArray& replyContents = reply->readAll(); const int statusCode = reply->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt(); const QString error ( reply->attribute( QNetworkRequest::HttpReasonPhraseAttribute ).toString() ); + QUrl redirectUrl = reply->attribute( QNetworkRequest::RedirectionTargetAttribute ).toUrl(); #ifdef KMESSDEBUG_HTTPSOAPCONNECTION_GENERAL bool requestSuccess = false; @@ -490,13 +491,17 @@ #endif // Parse the message contents - if( currentResponse->isFaultMessage() ) + if( !redirectUrl.isEmpty() || currentResponse->isFaultMessage() ) { // Verify if the server is redirecting us to another server if( currentResponse->getFaultCode() == "psf:Redirect" ) { + redirectUrl = XmlFunctions::getNodeValue( currentResponse->getFault(), "redirectUrl" ); + } + // Verify if the server is redirecting us to another server + if( !redirectUrl.isEmpty() ) + { const QUrl& originalUrl = currentResponse->getEndPoint(); - const QUrl redirectUrl( XmlFunctions::getNodeValue( currentResponse->getFault(), "redirectUrl" ) ); const QString originalHost( originalUrl.host() ); const QString redirectHost( redirectUrl.host() );