Fixed #210: Plus double-decoded for query string

This commit is contained in:
Andrew Godwin 2016-06-21 07:56:04 -07:00
parent 405e5b3b26
commit 6ea6dc6576

View File

@ -135,7 +135,11 @@ class AsgiRequest(http.HttpRequest):
@cached_property
def GET(self):
return http.QueryDict(self.message.get('query_string', '').encode("utf8"))
# Django will try and re-urldecode the string and interpret + as space;
# we re-encode + here to fix this.
return http.QueryDict(
self.message.get('query_string', '').replace("+", "%2b").encode("utf8"),
)
def _get_post(self):
if not hasattr(self, '_post'):