From ab3d59a74f3f7de37ad226aaedace71be0cf627e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=2E=20K=C3=A4rkk=C3=A4inen?= Date: Mon, 29 Jul 2019 19:29:01 +0300 Subject: [PATCH] Useless linter complaints. --- sanic/headers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sanic/headers.py b/sanic/headers.py index 9ef28fa3..3a375644 100644 --- a/sanic/headers.py +++ b/sanic/headers.py @@ -1,17 +1,17 @@ import re token, quoted = r"([\w!#$%&'*+\-.^_`|~]+)", r'"((?:[^"]|\\")*)"' -parameter = re.compile(fr';\s*{token}=(?:{token}|{quoted})', re.ASCII) +parameter = re.compile(fr";\s*{token}=(?:{token}|{quoted})", re.ASCII) def parse_options_header(value: str): """Parse HTTP header values of Content-Type format.""" - pos = value.find(';') + pos = value.find(";") if pos == -1: options = {} else: options = { - m.group(1).lower(): m.group(2) or m.group(3).replace(r'\"', '"') + m.group(1).lower(): m.group(2) or m.group(3).replace('\\"', '"') for m in parameter.finditer(value[pos:]) } value = value[:pos]