diff --git a/sanic/headers.py b/sanic/headers.py index 3a375644..5a37a815 100644 --- a/sanic/headers.py +++ b/sanic/headers.py @@ -1,5 +1,6 @@ import re + token, quoted = r"([\w!#$%&'*+\-.^_`|~]+)", r'"((?:[^"]|\\")*)"' parameter = re.compile(fr";\s*{token}=(?:{token}|{quoted})", re.ASCII) diff --git a/sanic/request.py b/sanic/request.py index 9191f8fa..5fd50353 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -11,8 +11,9 @@ from urllib.parse import parse_qs, parse_qsl, unquote, urlunparse from httptools import parse_url from sanic.exceptions import InvalidUsage -from sanic.log import error_logger, logger from sanic.headers import parse_options_header +from sanic.log import error_logger, logger + try: from ujson import loads as json_loads