Skip to content
Permalink
Browse files
Fix problem with parameter map in getrequesthandler
git-svn-id: http://svn.osgeo.org/qgis/trunk@14116 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 21, 2010
1 parent e5f6eb6 commit a201a8928ea23225d1d5a2f15aff7ff8b5a29549
Showing with 29 additions and 33 deletions.
  1. +29 −33 src/mapserver/qgsgetrequesthandler.cpp
@@ -36,55 +36,51 @@ std::map<QString, QString> QgsGetRequestHandler::parseInput()
QStringList elements = queryString.split( "&" );

QString element, key, value;
int separator = -1;

//insert key and value into the map
for ( QStringList::const_iterator it = elements.begin(); it != elements.end(); ++it )
{
element = *it;
if ( separator != -1 )
{
int sepidx = element.indexOf( "=", 0, Qt::CaseSensitive );
int sepidx = element.indexOf( "=", 0, Qt::CaseSensitive );

key = element.left( sepidx );
value = element.mid( sepidx + 1 );
value = QUrl::fromPercentEncoding( value.toLocal8Bit() ); //replace encoded special caracters and utf-8 encodings
key = element.left( sepidx );
value = element.mid( sepidx + 1 );
value = QUrl::fromPercentEncoding( value.toLocal8Bit() ); //replace encoded special caracters and utf-8 encodings


if ( key.compare( "SLD_BODY", Qt::CaseInsensitive ) == 0 )
{
key = "SLD";
}
else if ( key.compare( "SLD", Qt::CaseInsensitive ) == 0 )
if ( key.compare( "SLD_BODY", Qt::CaseInsensitive ) == 0 )
{
key = "SLD";
}
else if ( key.compare( "SLD", Qt::CaseInsensitive ) == 0 )
{
QByteArray fileContents;
if ( value.startsWith( "http", Qt::CaseInsensitive ) )
{
QByteArray fileContents;
if ( value.startsWith( "http", Qt::CaseInsensitive ) )
QgsHttpTransaction http( value );
if ( !http.getSynchronously( fileContents ) )
{
QgsHttpTransaction http( value );
if ( !http.getSynchronously( fileContents ) )
{
continue;
}
continue;
}
else if ( value.startsWith( "ftp", Qt::CaseInsensitive ) )
{
QgsFtpTransaction ftp;
if ( !ftp.get( value, fileContents ) )
{
continue;
}
value = QUrl::fromPercentEncoding( fileContents );
}
else
}
else if ( value.startsWith( "ftp", Qt::CaseInsensitive ) )
{
QgsFtpTransaction ftp;
if ( !ftp.get( value, fileContents ) )
{
continue; //only http and ftp supported at the moment
continue;
}
value = QUrl::fromPercentEncoding( fileContents );

}
parameters.insert( std::make_pair( key.toUpper(), value ) );
QgsMSDebugMsg( "qgsgetrequesthandler.cpp: inserting pair " + key.toUpper() + " // " + value + " into the parameter map" )
else
{
continue; //only http and ftp supported at the moment
}
value = QUrl::fromPercentEncoding( fileContents );

}
parameters.insert( std::make_pair( key.toUpper(), value ) );
QgsMSDebugMsg( "qgsgetrequesthandler.cpp: inserting pair " + key.toUpper() + " // " + value + " into the parameter map" )
}

//feature info format?

0 comments on commit a201a89

Please sign in to comment.