Always encode GET parameters back to bytes before calling urllib.quote()
Review Request #5732 — Created April 23, 2014 and submitted
When building the pagination links, the webapi code will iterate through all
the query parameters (excluding those related to pagination). These would then
be passed into urllib.quote(), which doesn't handle unicode strings (only
bytes).This manifested itself in the users list API when a query parameter had unicode
characters in it.
Ran new unit test before and after the code change. Saw that before it
reproduced the bug, and after it worked fine.
Description | From | Last Updated |
---|---|---|
We should probably do some real test with the result of the get(), and not just print. Can we do … |
chipx86 |
- Description:
-
When building the pagination links, the webapi code will iterate through all
the query parameters (excluding those related to pagination). These would then be passed into urllib.quote(), which doesn't handle unicode strings (only bytes). ~ This manifested itself in the users list API when a username had unicode
~ This manifested itself in the users list API when a query parameter had unicode
characters in it. - Testing Done:
-
+ Ran new unit test before and after the code change. Saw that before it
+ reproduced the bug, and after it worked fine. - Commit:
-
1c26666bbdf1c56d2a10319bfe26dd29cc85203630b6d919a90836aca77b07f933ba81ac6516d5b0
- Diff:
-
Revision 2 (+22 -2)
- Commit:
-
30b6d919a90836aca77b07f933ba81ac6516d5b00b6bf9a036f786099093bdcb53e1258f31fca6f2
- Diff:
-
Revision 3 (+28 -2)