From 9cb08e2138898a28ef528fe0737ad2f794844939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=2E=20K=C3=A4rkk=C3=A4inen?= Date: Thu, 22 Aug 2019 18:16:40 +0300 Subject: [PATCH] Add return type hint. --- sanic/headers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/headers.py b/sanic/headers.py index 5a37a815..d623b171 100644 --- a/sanic/headers.py +++ b/sanic/headers.py @@ -1,11 +1,12 @@ import re +import typing token, quoted = r"([\w!#$%&'*+\-.^_`|~]+)", r'"((?:[^"]|\\")*)"' parameter = re.compile(fr";\s*{token}=(?:{token}|{quoted})", re.ASCII) -def parse_options_header(value: str): +def parse_options_header(value: str) -> typing.Tuple[str, dict]: """Parse HTTP header values of Content-Type format.""" pos = value.find(";") if pos == -1: