We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03edac9 commit 95b4ebcCopy full SHA for 95b4ebc
src/server/qgswmsserver.cpp
@@ -2656,7 +2656,14 @@ bool QgsWMSServer::checkMaximumWidthHeight() const
2656
2657
QString QgsWMSServer::serviceUrl() const
2658
{
2659
- QUrl mapUrl( getenv( "REQUEST_URI" ) );
+ QString requestUri = getenv( "REQUEST_URI" );
2660
+ if ( requestUri.isEmpty() )
2661
+ {
2662
+ // in some cases (e.g. when running through python's CGIHTTPServer) the REQUEST_URI is not defined
2663
+ requestUri = QString( getenv( "SCRIPT_NAME" ) ) + "?" + QString( getenv( "QUERY_STRING" ) );
2664
+ }
2665
+
2666
+ QUrl mapUrl( requestUri );
2667
mapUrl.setHost( getenv( "SERVER_NAME" ) );
2668
2669
//Add non-default ports to url
0 commit comments