Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix auth basic non-ascii encoding
- Loading branch information
|
@@ -80,7 +80,7 @@ bool QgsAuthBasicMethod::updateNetworkRequest( QNetworkRequest &request, const Q |
|
|
|
|
|
if ( !username.isEmpty() ) |
|
|
{ |
|
|
request.setRawHeader( "Authorization", "Basic " + QStringLiteral( "%1:%2" ).arg( username, password ).toLatin1().toBase64() ); |
|
|
request.setRawHeader( "Authorization", "Basic " + QStringLiteral( "%1:%2" ).arg( username, password ).toUtf8().toBase64() ); |
|
|
} |
|
|
return true; |
|
|
} |
|
|
|
@@ -89,6 +89,8 @@ def testHeaderEncoding(self): |
|
|
for creds in ( |
|
|
('username', 'password'), |
|
|
('username', r'pa%%word'), |
|
|
('username', r'èé'), |
|
|
('username', r'😁😂😍'), |
|
|
): |
|
|
self.assertEqual(self._get_decoded_credentials(*creds), creds) |
|
|
|
|
|