mirror of https://github.com/encode/starlette.git
fix type annotations in responses.py (#1711)
This commit is contained in:
parent
795cf608f6
commit
c4e583b85d
|
@ -112,7 +112,7 @@ class Response:
|
||||||
httponly: bool = False,
|
httponly: bool = False,
|
||||||
samesite: typing.Optional[Literal["lax", "strict", "none"]] = "lax",
|
samesite: typing.Optional[Literal["lax", "strict", "none"]] = "lax",
|
||||||
) -> None:
|
) -> None:
|
||||||
cookie: http.cookies.BaseCookie = http.cookies.SimpleCookie()
|
cookie: "http.cookies.BaseCookie[str]" = http.cookies.SimpleCookie()
|
||||||
cookie[key] = value
|
cookie[key] = value
|
||||||
if max_age is not None:
|
if max_age is not None:
|
||||||
cookie[key]["max-age"] = max_age
|
cookie[key]["max-age"] = max_age
|
||||||
|
@ -185,7 +185,7 @@ class JSONResponse(Response):
|
||||||
self,
|
self,
|
||||||
content: typing.Any,
|
content: typing.Any,
|
||||||
status_code: int = 200,
|
status_code: int = 200,
|
||||||
headers: typing.Optional[dict] = None,
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
||||||
media_type: typing.Optional[str] = None,
|
media_type: typing.Optional[str] = None,
|
||||||
background: typing.Optional[BackgroundTask] = None,
|
background: typing.Optional[BackgroundTask] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
Loading…
Reference in New Issue