Add return type hint.

This commit is contained in:
L. Kärkkäinen 2019-08-22 18:16:40 +03:00
parent d04fc29223
commit 9cb08e2138

View File

@ -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: