From a39a7ca9d52fe3914c7ce16569e85cad3765faec Mon Sep 17 00:00:00 2001 From: John Doe <34662+johndoe46@users.noreply.github.com> Date: Mon, 16 Jul 2018 21:13:27 +0200 Subject: [PATCH] Add url_bytes to Request (#1258) We need to have access to the raw unparsed URL. --- sanic/request.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/request.py b/sanic/request.py index 7ce7620d..c8b470d4 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -48,10 +48,11 @@ class Request(dict): 'app', 'headers', 'version', 'method', '_cookies', 'transport', 'body', 'parsed_json', 'parsed_args', 'parsed_form', 'parsed_files', '_ip', '_parsed_url', 'uri_template', 'stream', '_remote_addr', - '_socket', '_port', '__weakref__' + '_socket', '_port', '__weakref__', 'raw_url' ) def __init__(self, url_bytes, headers, version, method, transport): + self.raw_url = url_bytes # TODO: Content-Encoding detection self._parsed_url = parse_url(url_bytes) self.app = None