[auth] Check for empty credentials instead of null

This commit is contained in:
Alessandro Pasotti 2017-10-06 16:33:53 +02:00
parent a7f132bc87
commit a4a33dff75

View File

@ -502,12 +502,12 @@ struct QgsWmsAuthorization
{
return QgsAuthManager::instance()->updateNetworkRequest( request, mAuthCfg );
}
else if ( !mUserName.isNull() || !mPassword.isNull() )
else if ( !mUserName.isEmpty() || !mPassword.isEmpty() )
{
request.setRawHeader( "Authorization", "Basic " + QStringLiteral( "%1:%2" ).arg( mUserName, mPassword ).toLatin1().toBase64() );
}
if ( !mReferer.isNull() )
if ( !mReferer.isEmpty() )
{
request.setRawHeader( "Referer", QStringLiteral( "%1" ).arg( mReferer ).toLatin1() );
}