Add return type hint.
This commit is contained in:
parent
d04fc29223
commit
9cb08e2138
|
@ -1,11 +1,12 @@
|
||||||
import re
|
import re
|
||||||
|
import typing
|
||||||
|
|
||||||
|
|
||||||
token, quoted = r"([\w!#$%&'*+\-.^_`|~]+)", r'"((?:[^"]|\\")*)"'
|
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):
|
def parse_options_header(value: str) -> typing.Tuple[str, dict]:
|
||||||
"""Parse HTTP header values of Content-Type format."""
|
"""Parse HTTP header values of Content-Type format."""
|
||||||
pos = value.find(";")
|
pos = value.find(";")
|
||||||
if pos == -1:
|
if pos == -1:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user