Skip to content

Commit

Permalink
use typing.Mapping for Response.headers (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
jouve authored Jan 27, 2022
1 parent 5a5a5c3 commit 2b54f42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions starlette/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
self,
content: typing.Any = None,
status_code: int = 200,
headers: dict = None,
headers: typing.Mapping[str, str] = None,
media_type: str = None,
background: BackgroundTask = None,
) -> None:
Expand Down Expand Up @@ -199,7 +199,7 @@ def __init__(
self,
url: typing.Union[str, URL],
status_code: int = 307,
headers: dict = None,
headers: typing.Mapping[str, str] = None,
background: BackgroundTask = None,
) -> None:
super().__init__(
Expand All @@ -213,7 +213,7 @@ def __init__(
self,
content: typing.Any,
status_code: int = 200,
headers: dict = None,
headers: typing.Mapping[str, str] = None,
media_type: str = None,
background: BackgroundTask = None,
) -> None:
Expand Down Expand Up @@ -268,7 +268,7 @@ def __init__(
self,
path: typing.Union[str, "os.PathLike[str]"],
status_code: int = 200,
headers: dict = None,
headers: typing.Mapping[str, str] = None,
media_type: str = None,
background: BackgroundTask = None,
filename: str = None,
Expand Down
4 changes: 2 additions & 2 deletions starlette/templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(
template: typing.Any,
context: dict,
status_code: int = 200,
headers: dict = None,
headers: typing.Mapping[str, str] = None,
media_type: str = None,
background: BackgroundTask = None,
):
Expand Down Expand Up @@ -85,7 +85,7 @@ def TemplateResponse(
name: str,
context: dict,
status_code: int = 200,
headers: dict = None,
headers: typing.Mapping[str, str] = None,
media_type: str = None,
background: BackgroundTask = None,
) -> _TemplateResponse:
Expand Down

0 comments on commit 2b54f42

Please sign in to comment.