Add _url_bytes slot to Request

Access to raw, unparsed URL is needed for some application with non-standard URLs like  ARK (Archival Resource Key)  (eg. http://domain.tld/ark:1234/qwert12? or http://domain.tld/ark:1234/qwert12??)
This commit is contained in:
John Doe 2018-07-04 04:13:11 +02:00 committed by GitHub
parent 9092ee9f0e
commit 3dee1ab8f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,12 +47,13 @@ class Request(dict):
__slots__ = ( __slots__ = (
'app', 'headers', 'version', 'method', '_cookies', 'transport', 'app', 'headers', 'version', 'method', '_cookies', 'transport',
'body', 'parsed_json', 'parsed_args', 'parsed_form', 'parsed_files', 'body', 'parsed_json', 'parsed_args', 'parsed_form', 'parsed_files',
'_ip', '_parsed_url', 'uri_template', 'stream', '_remote_addr', '_ip', '_url_bytes', '_parsed_url', 'uri_template', 'stream', '_remote_addr',
'_socket', '_port', '__weakref__' '_socket', '_port', '__weakref__'
) )
def __init__(self, url_bytes, headers, version, method, transport): def __init__(self, url_bytes, headers, version, method, transport):
# TODO: Content-Encoding detection # TODO: Content-Encoding detection
self._url_bytes = url_bytes
self._parsed_url = parse_url(url_bytes) self._parsed_url = parse_url(url_bytes)
self.app = None self.app = None