[QGIS-trac] Re: [Quantum GIS] #1733: When a / is on the end of an url http: is dropped from the GET

Quantum GIS qgis at qgis.org
Tue Jul 14 13:29:51 EDT 2009


#1733: When a / is on the end of an url http: is dropped from the GET
-----------------------------------------------------+----------------------
        Reporter:  skinkie                           |         Owner:  nobody                
            Type:  bug                               |        Status:  new                   
        Priority:  major: does not work as expected  |     Milestone:                        
       Component:  WMS                               |       Version:  HEAD                  
      Resolution:                                    |      Keywords:  http dropped end slash
Platform_version:                                    |      Platform:  Debian                
        Must_fix:  No                                |   Status_info:  0                     
-----------------------------------------------------+----------------------
Comment (by skinkie):

 Index: src/core/qgshttptransaction.cpp
 ===================================================================
 --- src/core/qgshttptransaction.cpp     (revision 11070)
 +++ src/core/qgshttptransaction.cpp     (working copy)
 @@ -133,9 +133,15 @@
    // http://www.address.bit:80), so remove that from the url before
    // executing an http GET.

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

 +  QgsDebugMsg( "qurl.path() is '" + qurl.path() + "'." );

 +  QString pathAndQuery = httpurl.remove( 0, httpurl.indexOf( qurl.host()
 ) );
 +  pathAndQuery = httpurl.remove( 0, pathAndQuery.indexOf( qurl.path() )
 );
 +
 +  QgsDebugMsg( "pathAndQuery is '" + pathAndQuery + "'." );
 +
 +
    if ( !postData ) //do request with HTTP GET
    {
      header.setRequest( "GET", pathAndQuery );


 The above fixes it, but if someone with real QT C++ skills can look at
 this, it would probably be better.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1733#comment:9>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list