Skip to content
Permalink
Browse files

Fix wms autorization logic

(cherry picked from commit 8379adb)
  • Loading branch information
elpaso authored and nyalldawson committed Apr 17, 2021
1 parent 4a12a45 commit 8005b28ec051c9bd5ea12df269d180c8c5588a5c
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/qgsdatasourceuri.cpp
  2. +1 −1 src/providers/wms/qgswmscapabilities.h
@@ -635,7 +635,7 @@ void QgsDataSourceUri::setEncodedUri( const QByteArray &uri )
mAuthConfigId.clear();

QUrl url;
url.setQuery( QString::fromUtf8( uri ) );
url.setQuery( QString::fromLatin1( uri ) );
const QUrlQuery query( url );

const auto constQueryItems = query.queryItems( QUrl::ComponentFormattingOption::FullyDecoded );
@@ -764,7 +764,7 @@ struct QgsWmsAuthorization
}
else if ( !mUserName.isEmpty() || !mPassword.isEmpty() )
{
request.setRawHeader( "Authorization", "Basic " + QStringLiteral( "%1:%2" ).arg( mUserName, mPassword ).toLatin1().toBase64() );
request.setRawHeader( "Authorization", "Basic " + QStringLiteral( "%1:%2" ).arg( mUserName, mPassword ).toUtf8().toBase64() );
}

if ( !mReferer.isEmpty() )

0 comments on commit 8005b28

Please sign in to comment.