Skip to content

Commit

Permalink
Remove server url from path. Some server reject such requests
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9696 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 24, 2008
1 parent fd60ebd commit 6d8848a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/core/qgshttptransaction.cpp
Expand Up @@ -113,22 +113,19 @@ bool QgsHttpTransaction::getSynchronously( QByteArray &respondedContent, int red
// includes the scheme, host and port (the
// http://www.address.bit:80), so remove that from the url before
// executing an http GET.
//
// gsherman 2008-10-24 - Not sure if the above still holds true. Commenting
// out the removal for testing purposes
// QString pathAndQuery = httpurl.remove( 0,
// httpurl.indexOf( qurl.path() ) );

QString pathAndQuery = httpurl.remove( 0, httpurl.indexOf( qurl.path() ) );


if ( !postData ) //do request with HTTP GET
{
header.setRequest( "GET", httpurl );
header.setRequest( "GET", pathAndQuery );
// do GET using header containing user-agent
httpid = http->request( header );
}
else //do request with HTTP POST
{
header.setRequest( "POST", httpurl );
header.setRequest( "POST", pathAndQuery );
// do POST using header containing user-agent
httpid = http->request( header, *postData );
}
Expand Down

0 comments on commit 6d8848a

Please sign in to comment.