Skip to content

Commit a775957

Browse files
committedOct 7, 2020
add robustness
1 parent d97d11f commit a775957

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,7 +3026,8 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPointXY &point, QgsRa
30263026
{
30273027
// rewrite the URL if the one in the capabilities document is incorrect
30283028
// strip every thing after the ? from the base url
3029-
const QString base = mSettings.mBaseUrl.split( QRegularExpression( "\\?" ) )[0];
3029+
const QList parts = mSettings.mBaseUrl.split( QRegularExpression( "\\?" ) );
3030+
const QString base = parts.isEmpty() ? mSettings.mBaseUrl : parts.first();
30303031
// and strip everything before the `rest` element (at least for GeoServer)
30313032
const int index = url.length() - url.lastIndexOf( QStringLiteral( "rest" ) ) + 1; // +1 for the /
30323033
url = base + url.right( index );
@@ -3054,7 +3055,6 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPointXY &point, QgsRa
30543055
else if ( !getFeatureInfoUrl().isNull() )
30553056
{
30563057
// KVP
3057-
QgsDebugMsg( QStringLiteral( "KVP ignore GetFeatureURL %1" ).arg( mSettings.mIgnoreGetFeatureInfoUrl ) );
30583058
QUrl url( mSettings.mIgnoreGetFeatureInfoUrl ? mSettings.mBaseUrl : getFeatureInfoUrl() );
30593059
QUrlQuery query( url );
30603060

0 commit comments

Comments
 (0)
Please sign in to comment.