Skip to content
Permalink
Browse files

Server: if map-parameter is missing in post parameters, check if it i…

…s passed as a get-parameter. Ported from Sourcepole QGIS Enterprise
  • Loading branch information
mhugent committed Jan 30, 2015
1 parent 57a5794 commit 7246b8308f5e9c914a63517fb84bae1b5d927163
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/server/qgspostrequesthandler.cpp
@@ -33,6 +33,19 @@ void QgsPostRequestHandler::parseInput()
QString inputString = readPostBody();
QgsDebugMsg( inputString );

//Map parameter in QUERY_STRING?
const char* qs = getenv( "QUERY_STRING" );
QMap<QString, QString> getParameters;
QString queryString;
QString mapParameter;
if ( qs )
{
queryString = QString( qs );
requestStringToParameterMap( queryString, getParameters );
mapParameter = getParameters.value( "MAP" );
}


QDomDocument doc;
QString errorMsg;
if ( !doc.setContent( inputString, true, &errorMsg ) )
@@ -64,4 +77,9 @@ void QgsPostRequestHandler::parseInput()
mParameterMap.insert( "REQUEST", docElem.tagName() );
mParameterMap.insert( "REQUEST_BODY", inputString );
}

if ( !mapParameter.isEmpty() && !mParameterMap.contains( "MAP" ) )
{
mParameterMap.insert( "MAP", mapParameter );
}
}

1 comment on commit 7246b83

@luca76

This comment has been minimized.

Copy link
Contributor

@luca76 luca76 commented on 7246b83 Feb 2, 2015

+1, it would be a great fix for 2.8!

Please sign in to comment.
You can’t perform that action at this time.