From abd0609f80f5bed652e314e5a2a47a7bb2155c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannik=20R=C3=B6del?= Date: Fri, 9 Sep 2022 15:48:24 +0200 Subject: [PATCH] Add type and parameter fields to MediaType (#1103) --- django-stubs/http/multipartparser.pyi | 2 +- django-stubs/http/request.pyi | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/django-stubs/http/multipartparser.pyi b/django-stubs/http/multipartparser.pyi index 5181052..e157729 100644 --- a/django-stubs/http/multipartparser.pyi +++ b/django-stubs/http/multipartparser.pyi @@ -55,4 +55,4 @@ class Parser: def __init__(self, stream: LazyStream, boundary: bytes) -> None: ... def __iter__(self) -> Iterator[Tuple[str, Dict[str, Tuple[str, Dict[str, Union[bytes, str]]]], LazyStream]]: ... -def parse_header(line: bytes) -> Tuple[str, Dict[str, Any]]: ... +def parse_header(line: bytes) -> Tuple[str, Dict[str, bytes]]: ... diff --git a/django-stubs/http/request.pyi b/django-stubs/http/request.pyi index 6ae9e25..f4d849b 100644 --- a/django-stubs/http/request.pyi +++ b/django-stubs/http/request.pyi @@ -200,6 +200,9 @@ class _ImmutableQueryDict(QueryDict): def dict(self) -> Dict[str, str]: ... # type: ignore[override] class MediaType: + main_type: str + sub_type: str + params: Dict[str, bytes] def __init__(self, media_type_raw_line: str) -> None: ... @property def is_all_types(self) -> bool: ...