mirror of https://github.com/tiangolo/fastapi.git
⬆ Upgrade Starlette from 0.18.0 to 0.19.0 (#4488)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
9090c771ee
commit
86fa3cb24f
|
|
@ -12,8 +12,9 @@ class HTTPException(StarletteHTTPException):
|
|||
detail: Any = None,
|
||||
headers: Optional[Dict[str, Any]] = None,
|
||||
) -> None:
|
||||
super().__init__(status_code=status_code, detail=detail)
|
||||
self.headers = headers
|
||||
super().__init__(
|
||||
status_code=status_code, detail=detail, headers=headers # type: ignore
|
||||
)
|
||||
|
||||
|
||||
RequestErrorModel: Type[BaseModel] = create_model("Request")
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ classifiers = [
|
|||
"Topic :: Internet :: WWW/HTTP",
|
||||
]
|
||||
requires = [
|
||||
"starlette ==0.18.0",
|
||||
"starlette==0.19.0",
|
||||
"pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
|
||||
]
|
||||
description-file = "README.md"
|
||||
|
|
@ -140,6 +140,7 @@ filterwarnings = [
|
|||
"error",
|
||||
# TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8
|
||||
'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
|
||||
'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette',
|
||||
# TODO: remove after dropping support for Python 3.6
|
||||
'ignore:Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.:UserWarning:jose',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ def delete_item(item_id: str, item: Item):
|
|||
|
||||
@app.head("/items/{item_id}")
|
||||
def head_item(item_id: str):
|
||||
return JSONResponse(headers={"x-fastapi-item-id": item_id})
|
||||
return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
|
||||
|
||||
|
||||
@app.options("/items/{item_id}")
|
||||
def options_item(item_id: str):
|
||||
return JSONResponse(headers={"x-fastapi-item-id": item_id})
|
||||
return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
|
||||
|
||||
|
||||
@app.patch("/items/{item_id}")
|
||||
|
|
@ -47,7 +47,7 @@ def patch_item(item_id: str, item: Item):
|
|||
|
||||
@app.trace("/items/{item_id}")
|
||||
def trace_item(item_id: str):
|
||||
return JSONResponse(media_type="message/http")
|
||||
return JSONResponse(None, media_type="message/http")
|
||||
|
||||
|
||||
client = TestClient(app)
|
||||
|
|
|
|||
Loading…
Reference in New Issue