mirror of
https://github.com/fergalmoran/picard.git
synced 2026-03-27 23:55:14 +00:00
_query_data(): Use urllib.parse.urlencode() instead of QUrl/QUrlQuery
Note: previously spaces weren't encoded, with this change they are (as plus) which is more conform to expected format for application/x-www-form-urlencoded Actually this was a bug in previous version, as addQueryItem() didn't encode spaces as they should See https://doc.qt.io/qt-5/qurlquery.html#addQueryItem "This method does not treat spaces (ASCII 0x20) and plus ("+") signs as the same, like HTML forms do. If you need spaces to be represented as plus signs, use actual plus signs." It wasn't an issue because none of passed data should contain spaces in our current code
This commit is contained in:
@@ -33,4 +33,4 @@ class OAuthManagerTest(PicardTestCase):
|
||||
'': '',
|
||||
}
|
||||
data = OAuthManager._query_data(params)
|
||||
self.assertEqual(data, "a%26b=a b&c d=c%26d")
|
||||
self.assertEqual(data, "a%26b=a+b&c+d=c%26d")
|
||||
|
||||
Reference in New Issue
Block a user