From 6ea6dc65769e03c6f5bc66f29460227616110143 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Tue, 21 Jun 2016 07:56:04 -0700 Subject: [PATCH] Fixed #210: Plus double-decoded for query string --- channels/handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/channels/handler.py b/channels/handler.py index 0e0f4e1..02e474b 100644 --- a/channels/handler.py +++ b/channels/handler.py @@ -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'):