Upgrading starlette 0.46 to 0.47
Review needed0.46.2 β 0.47.3Security1New2Changed2Fixed5
SecurityMedium Β· CVSS 5.3Starlette has possible denial-of-service vector when parsing large files in multipart formsGHSA-2c2j-9gv5-cj73 Β· CVE-2025-54121 β
Review neededUpgrade verdict
2 changed defaults and a security fix.
In plain terms
- Starlette has possible denial-of-service vector when parsing large files in multipart forms
Must act 1 item needs code or config changes
What you must change
Security1
Starlette has possible denial-of-service vector when parsing large files in multipart forms
Medium Β· CVSS 5.3API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- changed:
constructor Starlette(debug: bool=β¦, routes: typing.Sequence[BaseRoute] | None=β¦, middleware: typing.Sequence[Middleware] | None=β¦, exception_handlers: typing.Mapping[typing.Any, ExceptionHandler] | None=β¦, on_startup: typing.Sequence[typing.Callable[[], typing.Any]] | None=β¦, on_shutdown: typing.Sequence[typing.Callable[[], typing.Any]] | None=β¦, lifespan: Lifespan[AppType] | None=β¦) -> None β constructor Starlette(debug: bool=β¦, routes: Sequence[BaseRoute] | None=β¦, middleware: Sequence[Middleware] | None=β¦, exception_handlers: Mapping[Any, ExceptionHandler] | None=β¦, on_startup: Sequence[Callable[[], Any]] | None=β¦, on_shutdown: Sequence[Callable[[], Any]] | None=β¦, lifespan: Lifespan[AppType] | None=β¦) -> None - changed:
method Starlette.add_event_handler(event_type: str, func: typing.Callable) -> None β method Starlette.add_event_handler(event_type: str, func: Callable) -> None - changed:
method Starlette.add_route(path: str, route: typing.Callable[[Request], typing.Awaitable[Response] | Response], methods: list[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> None β method Starlette.add_route(path: str, route: Callable[[Request], Awaitable[Response] | Response], methods: list[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> None - changed:
method Starlette.add_websocket_route(path: str, route: typing.Callable[[WebSocket], typing.Awaitable[None]], name: str | None=β¦) -> None β method Starlette.add_websocket_route(path: str, route: Callable[[WebSocket], Awaitable[None]], name: str | None=β¦) -> None - changed:
method Starlette.exception_handler(exc_class_or_status_code: int | type[Exception]) -> typing.Callable β method Starlette.exception_handler(exc_class_or_status_code: int | type[Exception]) -> Callable - changed:
method Starlette.middleware(middleware_type: str) -> typing.Callable β method Starlette.middleware(middleware_type: str) -> Callable - changed:
method Starlette.on_event(event_type: str) -> typing.Callable β method Starlette.on_event(event_type: str) -> Callable - changed:
method Starlette.route(path: str, methods: list[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> typing.Callable β method Starlette.route(path: str, methods: list[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> Callable - changed:
method Starlette.url_path_for(name: str, /, **path_params: typing.Any) -> URLPath β method Starlette.url_path_for(name: str, /, **path_params: Any) -> URLPath - changed:
method Starlette.websocket_route(path: str, name: str | None=β¦) -> typing.Callable β method Starlette.websocket_route(path: str, name: str | None=β¦) -> Callable
- changed:
constructor AuthCredentials(scopes: typing.Sequence[str] | None=β¦) β constructor AuthCredentials(scopes: Sequence[str] | None=β¦) - changed:
function has_required_scope(conn: HTTPConnection, scopes: typing.Sequence[str]) -> bool β function has_required_scope(conn: HTTPConnection, scopes: Sequence[str]) -> bool - changed:
function requires(scopes: str | typing.Sequence[str], status_code: int=β¦, redirect: str | None=β¦) -> typing.Callable[[typing.Callable[_P, typing.Any]], typing.Callable[_P, typing.Any]] β function requires(scopes: str | Sequence[str], status_code: int=β¦, redirect: str | None=β¦) -> Callable[[Callable[_P, Any]], Callable[_P, Any]]
- changed:
constructor BackgroundTask(func: typing.Callable[P, typing.Any], *args: P.args, **kwargs: P.kwargs) -> None β constructor BackgroundTask(func: Callable[P, Any], *args: P.args, **kwargs: P.kwargs) -> None - changed:
constructor BackgroundTasks(tasks: typing.Sequence[BackgroundTask] | None=β¦) β constructor BackgroundTasks(tasks: Sequence[BackgroundTask] | None=β¦) - changed:
method BackgroundTasks.add_task(func: typing.Callable[P, typing.Any], *args: P.args, **kwargs: P.kwargs) -> None β method BackgroundTasks.add_task(func: Callable[P, Any], *args: P.args, **kwargs: P.kwargs) -> None
- changed:
async function iterate_in_threadpool(iterator: typing.Iterable[T]) -> typing.AsyncIterator[T] β async function iterate_in_threadpool(iterator: Iterable[T]) -> AsyncIterator[T] - changed:
async function run_in_threadpool(func: typing.Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> T β async function run_in_threadpool(func: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> T - changed:
async function run_until_first_complete(*args: tuple[typing.Callable, dict]) -> None β async function run_until_first_complete(*args: tuple[Callable, dict]) -> None
- changed:
class Environ(typing.MutableMapping[str, str]) β class Environ(MutableMapping[str, str]) - changed:
constructor Config(env_file: str | Path | None=β¦, environ: typing.Mapping[str, str]=β¦, env_prefix: str=β¦) -> None β constructor Config(env_file: str | Path | None=β¦, environ: Mapping[str, str]=β¦, env_prefix: str=β¦) -> None - changed:
constructor Environ(environ: typing.MutableMapping[str, str]=β¦) β constructor Environ(environ: MutableMapping[str, str]=β¦) - changed:
method Config.get(key: str, cast: typing.Callable[[typing.Any], typing.Any] | None=β¦, default: typing.Any=β¦) -> typing.Any β method Config.get(key: str, cast: Callable[[Any], Any] | None=β¦, default: Any=β¦) -> Any
- changed:
class Convertor(typing.Generic[T]) β class Convertor(Generic[T]) - changed:
field Convertor.regex: typing.ClassVar[str] β field Convertor.regex: ClassVar[str] - changed:
function register_url_convertor(key: str, convertor: Convertor[typing.Any]) -> None β function register_url_convertor(key: str, convertor: Convertor[Any]) -> None - changed:
variable CONVERTOR_TYPES: dict[str, Convertor[typing.Any]] β variable CONVERTOR_TYPES: dict[str, Convertor[Any]]
- changed:
class Address(typing.NamedTuple) β class Address(NamedTuple) - changed:
class CommaSeparatedStrings(typing.Sequence[str]) β class CommaSeparatedStrings(Sequence[str]) - changed:
class FormData(ImmutableMultiDict[str, typing.Union[UploadFile, str]]) β class FormData(ImmutableMultiDict[str, Union[UploadFile, str]]) - changed:
class Headers(typing.Mapping[str, str]) β class Headers(Mapping[str, str]) - changed:
class ImmutableMultiDict(typing.Mapping[_KeyType, _CovariantValueType]) β class ImmutableMultiDict(Mapping[_KeyType, _CovariantValueType]) - changed:
class MultiDict(ImmutableMultiDict[typing.Any, typing.Any]) β class MultiDict(ImmutableMultiDict[Any, Any]) - changed:
constructor CommaSeparatedStrings(value: str | typing.Sequence[str]) β constructor CommaSeparatedStrings(value: str | Sequence[str]) - changed:
constructor FormData(*args: FormData | typing.Mapping[str, str | UploadFile] | list[tuple[str, str | UploadFile]], **kwargs: str | UploadFile) -> None β constructor FormData(*args: FormData | Mapping[str, str | UploadFile] | list[tuple[str, str | UploadFile]], **kwargs: str | UploadFile) -> None - changed:
constructor Headers(headers: typing.Mapping[str, str] | None=β¦, raw: list[tuple[bytes, bytes]] | None=β¦, scope: typing.MutableMapping[str, typing.Any] | None=β¦) -> None β constructor Headers(headers: Mapping[str, str] | None=β¦, raw: list[tuple[bytes, bytes]] | None=β¦, scope: MutableMapping[str, Any] | None=β¦) -> None - changed:
constructor ImmutableMultiDict(*args: ImmutableMultiDict[_KeyType, _CovariantValueType] | typing.Mapping[_KeyType, _CovariantValueType] | typing.Iterable[tuple[_KeyType, _CovariantValueType]], **kwargs: typing.Any) -> None β constructor ImmutableMultiDict(*args: ImmutableMultiDict[_KeyType, _CovariantValueType] | Mapping[_KeyType, _CovariantValueType] | Iterable[tuple[_KeyType, _CovariantValueType]], **kwargs: Any) -> None - changed:
constructor QueryParams(*args: ImmutableMultiDict[typing.Any, typing.Any] | typing.Mapping[typing.Any, typing.Any] | list[tuple[typing.Any, typing.Any]] | str | bytes, **kwargs: typing.Any) -> None β constructor QueryParams(*args: ImmutableMultiDict[Any, Any] | Mapping[Any, Any] | list[tuple[Any, Any]] | str | bytes, **kwargs: Any) -> None - changed:
constructor State(state: dict[str, typing.Any] | None=β¦) β constructor State(state: dict[str, Any] | None=β¦) - changed:
constructor URL(url: str=β¦, scope: Scope | None=β¦, **components: typing.Any) -> None β constructor URL(url: str=β¦, scope: Scope | None=β¦, **components: Any) -> None - changed:
constructor UploadFile(file: typing.BinaryIO, *, size: int | None=β¦, filename: str | None=β¦, headers: Headers | None=β¦) -> None β constructor UploadFile(file: BinaryIO, *, size: int | None=β¦, filename: str | None=β¦, headers: Headers | None=β¦) -> None - changed:
method ImmutableMultiDict.getlist(key: typing.Any) -> list[_CovariantValueType] β method ImmutableMultiDict.getlist(key: Any) -> list[_CovariantValueType] - changed:
method ImmutableMultiDict.items() -> typing.ItemsView[_KeyType, _CovariantValueType] β method ImmutableMultiDict.items() -> ItemsView[_KeyType, _CovariantValueType] - changed:
method ImmutableMultiDict.keys() -> typing.KeysView[_KeyType] β method ImmutableMultiDict.keys() -> KeysView[_KeyType] - changed:
method ImmutableMultiDict.values() -> typing.ValuesView[_CovariantValueType] β method ImmutableMultiDict.values() -> ValuesView[_CovariantValueType] - changed:
method MultiDict.append(key: typing.Any, value: typing.Any) -> None β method MultiDict.append(key: Any, value: Any) -> None - changed:
method MultiDict.pop(key: typing.Any, default: typing.Any=β¦) -> typing.Any β method MultiDict.pop(key: Any, default: Any=β¦) -> Any - changed:
method MultiDict.popitem() -> tuple[typing.Any, typing.Any] β method MultiDict.popitem() -> tuple[Any, Any] - changed:
method MultiDict.poplist(key: typing.Any) -> list[typing.Any] β method MultiDict.poplist(key: Any) -> list[Any] - changed:
method MultiDict.setdefault(key: typing.Any, default: typing.Any=β¦) -> typing.Any β method MultiDict.setdefault(key: Any, default: Any=β¦) -> Any - changed:
method MultiDict.setlist(key: typing.Any, values: list[typing.Any]) -> None β method MultiDict.setlist(key: Any, values: list[Any]) -> None - changed:
method MultiDict.update(*args: MultiDict | typing.Mapping[typing.Any, typing.Any] | list[tuple[typing.Any, typing.Any]], **kwargs: typing.Any) -> None β method MultiDict.update(*args: MultiDict | Mapping[Any, Any] | list[tuple[Any, Any]], **kwargs: Any) -> None - changed:
method MutableHeaders.update(other: typing.Mapping[str, str]) -> None β method MutableHeaders.update(other: Mapping[str, str]) -> None - changed:
method URL.include_query_params(**kwargs: typing.Any) -> URL β method URL.include_query_params(**kwargs: Any) -> URL - changed:
method URL.remove_query_params(keys: str | typing.Sequence[str]) -> URL β method URL.remove_query_params(keys: str | Sequence[str]) -> URL - changed:
method URL.replace(**kwargs: typing.Any) -> URL β method URL.replace(**kwargs: Any) -> URL - changed:
method URL.replace_query_params(**kwargs: typing.Any) -> URL β method URL.replace_query_params(**kwargs: Any) -> URL
- changed:
async method WebSocketEndpoint.decode(websocket: WebSocket, message: Message) -> typing.Any β async method WebSocketEndpoint.decode(websocket: WebSocket, message: Message) -> Any - changed:
async method WebSocketEndpoint.on_receive(websocket: WebSocket, data: typing.Any) -> None β async method WebSocketEndpoint.on_receive(websocket: WebSocket, data: Any) -> None
- changed:
constructor FormParser(headers: Headers, stream: typing.AsyncGenerator[bytes, None]) -> None β constructor FormParser(headers: Headers, stream: AsyncGenerator[bytes, None]) -> None - changed:
constructor MultiPartParser(headers: Headers, stream: typing.AsyncGenerator[bytes, None], *, max_files: int | float=β¦, max_fields: int | float=β¦, max_part_size: int=β¦) -> None β constructor MultiPartParser(headers: Headers, stream: AsyncGenerator[bytes, None], *, max_files: int | float=β¦, max_fields: int | float=β¦, max_part_size: int=β¦) -> None
- changed:
constructor AuthenticationMiddleware(app: ASGIApp, backend: AuthenticationBackend, on_error: typing.Callable[[HTTPConnection, AuthenticationError], Response] | None=β¦) -> None β constructor AuthenticationMiddleware(app: ASGIApp, backend: AuthenticationBackend, on_error: Callable[[HTTPConnection, AuthenticationError], Response] | None=β¦) -> None
- added:
variable AsyncContentStream - added:
variable BodyStreamGenerator
- changed:
constructor CORSMiddleware(app: ASGIApp, allow_origins: typing.Sequence[str]=β¦, allow_methods: typing.Sequence[str]=β¦, allow_headers: typing.Sequence[str]=β¦, allow_credentials: bool=β¦, allow_origin_regex: str | None=β¦, expose_headers: typing.Sequence[str]=β¦, max_age: int=β¦) -> None β constructor CORSMiddleware(app: ASGIApp, allow_origins: Sequence[str]=β¦, allow_methods: Sequence[str]=β¦, allow_headers: Sequence[str]=β¦, allow_credentials: bool=β¦, allow_origin_regex: str | None=β¦, expose_headers: Sequence[str]=β¦, max_age: int=β¦) -> None
- changed:
constructor ServerErrorMiddleware(app: ASGIApp, handler: typing.Callable[[Request, Exception], typing.Any] | None=β¦, debug: bool=β¦) -> None β constructor ServerErrorMiddleware(app: ASGIApp, handler: ExceptionHandler | None=β¦, debug: bool=β¦) -> None
- changed:
constructor ExceptionMiddleware(app: ASGIApp, handlers: typing.Mapping[typing.Any, typing.Callable[[Request, Exception], Response]] | None=β¦, debug: bool=β¦) -> None β constructor ExceptionMiddleware(app: ASGIApp, handlers: Mapping[Any, ExceptionHandler] | None=β¦, debug: bool=β¦) -> None - changed:
method ExceptionMiddleware.add_exception_handler(exc_class_or_status_code: int | type[Exception], handler: typing.Callable[[Request, Exception], Response]) -> None β method ExceptionMiddleware.add_exception_handler(exc_class_or_status_code: int | type[Exception], handler: ExceptionHandler) -> None - changed:
method ExceptionMiddleware.http_exception(request: Request, exc: Exception) -> Response β async method ExceptionMiddleware.http_exception(request: Request, exc: Exception) -> Response
- changed:
async function unattached_send(message: Message) -> typing.NoReturn β async function unattached_send(message: Message) -> NoReturn
- changed:
constructor SessionMiddleware(app: ASGIApp, secret_key: str | Secret, session_cookie: str=β¦, max_age: int | None=β¦, path: str=β¦, same_site: typing.Literal['lax', 'strict', 'none']=β¦, https_only: bool=β¦, domain: str | None=β¦) -> None β constructor SessionMiddleware(app: ASGIApp, secret_key: str | Secret, session_cookie: str=β¦, max_age: int | None=β¦, path: str=β¦, same_site: Literal['lax', 'strict', 'none']=β¦, https_only: bool=β¦, domain: str | None=β¦) -> None
- changed:
constructor TrustedHostMiddleware(app: ASGIApp, allowed_hosts: typing.Sequence[str] | None=β¦, www_redirect: bool=β¦) -> None β constructor TrustedHostMiddleware(app: ASGIApp, allowed_hosts: Sequence[str] | None=β¦, www_redirect: bool=β¦) -> None
- changed:
constructor WSGIMiddleware(app: typing.Callable[..., typing.Any]) -> None β constructor WSGIMiddleware(app: Callable[..., Any]) -> None - changed:
constructor WSGIResponder(app: typing.Callable[..., typing.Any], scope: Scope) -> None β constructor WSGIResponder(app: Callable[..., Any], scope: Scope) -> None - changed:
field WSGIResponder.stream_receive: ObjectReceiveStream[typing.MutableMapping[str, typing.Any]] β field WSGIResponder.stream_receive: ObjectReceiveStream[MutableMapping[str, Any]] - changed:
field WSGIResponder.stream_send: ObjectSendStream[typing.MutableMapping[str, typing.Any]] β field WSGIResponder.stream_send: ObjectSendStream[MutableMapping[str, Any]] - changed:
function build_environ(scope: Scope, body: bytes) -> dict[str, typing.Any] β function build_environ(scope: Scope, body: bytes) -> dict[str, Any] - changed:
method WSGIResponder.start_response(status: str, response_headers: list[tuple[str, str]], exc_info: typing.Any=β¦) -> None β method WSGIResponder.start_response(status: str, response_headers: list[tuple[str, str]], exc_info: Any=β¦) -> None - changed:
method WSGIResponder.wsgi(environ: dict[str, typing.Any], start_response: typing.Callable[..., typing.Any]) -> None β method WSGIResponder.wsgi(environ: dict[str, Any], start_response: Callable[..., Any]) -> None
- removed:
property HTTPConnection.app -> typing.Any - removed:
property HTTPConnection.auth -> typing.Any - removed:
property HTTPConnection.path_params -> dict[str, typing.Any] - removed:
property HTTPConnection.session -> dict[str, typing.Any] - removed:
property HTTPConnection.user -> typing.Any - changed:
async function empty_receive() -> typing.NoReturn β async function empty_receive() -> NoReturn - changed:
async function empty_send(message: Message) -> typing.NoReturn β async function empty_send(message: Message) -> NoReturn - changed:
async method Request.json() -> typing.Any β async method Request.json() -> Any - changed:
async method Request.stream() -> typing.AsyncGenerator[bytes, None] β async method Request.stream() -> AsyncGenerator[bytes, None] - changed:
class HTTPConnection(typing.Mapping[str, typing.Any]) β class HTTPConnection(Mapping[str, Any]) - changed:
method HTTPConnection.url_for(name: str, /, **path_params: typing.Any) -> URL β method HTTPConnection.url_for(name: str, /, **path_params: Any) -> URL - added:
property HTTPConnection.app -> Any - added:
property HTTPConnection.auth -> Any - added:
property HTTPConnection.path_params -> dict[str, Any] - added:
property HTTPConnection.session -> dict[str, Any] - added:
property HTTPConnection.user -> Any
- changed:
constructor FileResponse(path: str | os.PathLike[str], status_code: int=β¦, headers: typing.Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦, filename: str | None=β¦, stat_result: os.stat_result | None=β¦, method: str | None=β¦, content_disposition_type: str=β¦) -> None β constructor FileResponse(path: str | os.PathLike[str], status_code: int=β¦, headers: Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦, filename: str | None=β¦, stat_result: os.stat_result | None=β¦, method: str | None=β¦, content_disposition_type: str=β¦) -> None - changed:
constructor JSONResponse(content: typing.Any, status_code: int=β¦, headers: typing.Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> None β constructor JSONResponse(content: Any, status_code: int=β¦, headers: Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> None - changed:
constructor RedirectResponse(url: str | URL, status_code: int=β¦, headers: typing.Mapping[str, str] | None=β¦, background: BackgroundTask | None=β¦) -> None β constructor RedirectResponse(url: str | URL, status_code: int=β¦, headers: Mapping[str, str] | None=β¦, background: BackgroundTask | None=β¦) -> None - changed:
constructor Response(content: typing.Any=β¦, status_code: int=β¦, headers: typing.Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> None β constructor Response(content: Any=β¦, status_code: int=β¦, headers: Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> None - changed:
constructor StreamingResponse(content: ContentStream, status_code: int=β¦, headers: typing.Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> None β constructor StreamingResponse(content: ContentStream, status_code: int=β¦, headers: Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> None - changed:
method FileResponse.generate_multipart(ranges: typing.Sequence[tuple[int, int]], boundary: str, max_size: int, content_type: str) -> tuple[int, typing.Callable[[int, int], bytes]] β method FileResponse.generate_multipart(ranges: Sequence[tuple[int, int]], boundary: str, max_size: int, content_type: str) -> tuple[int, Callable[[int, int], bytes]] - changed:
method JSONResponse.render(content: typing.Any) -> bytes β method JSONResponse.render(content: Any) -> bytes - changed:
method Response.delete_cookie(key: str, path: str=β¦, domain: str | None=β¦, secure: bool=β¦, httponly: bool=β¦, samesite: typing.Literal['lax', 'strict', 'none'] | None=β¦) -> None β method Response.delete_cookie(key: str, path: str=β¦, domain: str | None=β¦, secure: bool=β¦, httponly: bool=β¦, samesite: Literal['lax', 'strict', 'none'] | None=β¦) -> None - changed:
method Response.init_headers(headers: typing.Mapping[str, str] | None=β¦) -> None β method Response.init_headers(headers: Mapping[str, str] | None=β¦) -> None - changed:
method Response.render(content: typing.Any) -> bytes | memoryview β method Response.render(content: Any) -> bytes | memoryview - changed:
method Response.set_cookie(key: str, value: str=β¦, max_age: int | None=β¦, expires: datetime | str | int | None=β¦, path: str | None=β¦, domain: str | None=β¦, secure: bool=β¦, httponly: bool=β¦, samesite: typing.Literal['lax', 'strict', 'none'] | None=β¦) -> None β method Response.set_cookie(key: str, value: str=β¦, max_age: int | None=β¦, expires: datetime | str | int | None=β¦, path: str | None=β¦, domain: str | None=β¦, secure: bool=β¦, httponly: bool=β¦, samesite: Literal['lax', 'strict', 'none'] | None=β¦, partitioned: bool=β¦) -> None
- changed:
constructor Mount(path: str, app: ASGIApp | None=β¦, routes: typing.Sequence[BaseRoute] | None=β¦, name: str | None=β¦, *, middleware: typing.Sequence[Middleware] | None=β¦) -> None β constructor Mount(path: str, app: ASGIApp | None=β¦, routes: Sequence[BaseRoute] | None=β¦, name: str | None=β¦, *, middleware: Sequence[Middleware] | None=β¦) -> None - changed:
constructor NoMatchFound(name: str, path_params: dict[str, typing.Any]) -> None β constructor NoMatchFound(name: str, path_params: dict[str, Any]) -> None - changed:
constructor Route(path: str, endpoint: typing.Callable[..., typing.Any], *, methods: list[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦, middleware: typing.Sequence[Middleware] | None=β¦) -> None β constructor Route(path: str, endpoint: Callable[..., Any], *, methods: Collection[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦, middleware: Sequence[Middleware] | None=β¦) -> None - changed:
constructor Router(routes: typing.Sequence[BaseRoute] | None=β¦, redirect_slashes: bool=β¦, default: ASGIApp | None=β¦, on_startup: typing.Sequence[typing.Callable[[], typing.Any]] | None=β¦, on_shutdown: typing.Sequence[typing.Callable[[], typing.Any]] | None=β¦, lifespan: Lifespan[typing.Any] | None=β¦, *, middleware: typing.Sequence[Middleware] | None=β¦) -> None β constructor Router(routes: Sequence[BaseRoute] | None=β¦, redirect_slashes: bool=β¦, default: ASGIApp | None=β¦, on_startup: Sequence[Callable[[], Any]] | None=β¦, on_shutdown: Sequence[Callable[[], Any]] | None=β¦, lifespan: Lifespan[Any] | None=β¦, *, middleware: Sequence[Middleware] | None=β¦) -> None - changed:
constructor WebSocketRoute(path: str, endpoint: typing.Callable[..., typing.Any], *, name: str | None=β¦, middleware: typing.Sequence[Middleware] | None=β¦) -> None β constructor WebSocketRoute(path: str, endpoint: Callable[..., Any], *, name: str | None=β¦, middleware: Sequence[Middleware] | None=β¦) -> None - changed:
function compile_path(path: str) -> tuple[typing.Pattern[str], str, dict[str, Convertor[typing.Any]]] β function compile_path(path: str) -> tuple[Pattern[str], str, dict[str, Convertor[Any]]] - changed:
function get_name(endpoint: typing.Callable[..., typing.Any]) -> str β function get_name(endpoint: Callable[..., Any]) -> str - changed:
function iscoroutinefunction_or_partial(obj: typing.Any) -> bool β function iscoroutinefunction_or_partial(obj: Any) -> bool - changed:
function replace_params(path: str, param_convertors: dict[str, Convertor[typing.Any]], path_params: dict[str, str]) -> tuple[str, dict[str, str]] β function replace_params(path: str, param_convertors: dict[str, Convertor[Any]], path_params: dict[str, str]) -> tuple[str, dict[str, str]] - changed:
function request_response(func: typing.Callable[[Request], typing.Awaitable[Response] | Response]) -> ASGIApp β function request_response(func: Callable[[Request], Awaitable[Response] | Response]) -> ASGIApp - changed:
function websocket_session(func: typing.Callable[[WebSocket], typing.Awaitable[None]]) -> ASGIApp β function websocket_session(func: Callable[[WebSocket], Awaitable[None]]) -> ASGIApp - changed:
method BaseRoute.url_path_for(name: str, /, **path_params: typing.Any) -> URLPath β method BaseRoute.url_path_for(name: str, /, **path_params: Any) -> URLPath - changed:
method Host.url_path_for(name: str, /, **path_params: typing.Any) -> URLPath β method Host.url_path_for(name: str, /, **path_params: Any) -> URLPath - changed:
method Mount.url_path_for(name: str, /, **path_params: typing.Any) -> URLPath β method Mount.url_path_for(name: str, /, **path_params: Any) -> URLPath - changed:
method Route.url_path_for(name: str, /, **path_params: typing.Any) -> URLPath β method Route.url_path_for(name: str, /, **path_params: Any) -> URLPath - changed:
method Router.add_event_handler(event_type: str, func: typing.Callable[[], typing.Any]) -> None β method Router.add_event_handler(event_type: str, func: Callable[[], Any]) -> None - changed:
method Router.add_route(path: str, endpoint: typing.Callable[[Request], typing.Awaitable[Response] | Response], methods: list[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> None β method Router.add_route(path: str, endpoint: Callable[[Request], Awaitable[Response] | Response], methods: Collection[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> None - changed:
method Router.add_websocket_route(path: str, endpoint: typing.Callable[[WebSocket], typing.Awaitable[None]], name: str | None=β¦) -> None β method Router.add_websocket_route(path: str, endpoint: Callable[[WebSocket], Awaitable[None]], name: str | None=β¦) -> None - changed:
method Router.on_event(event_type: str) -> typing.Callable β method Router.on_event(event_type: str) -> Callable - changed:
method Router.route(path: str, methods: list[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> typing.Callable β method Router.route(path: str, methods: Collection[str] | None=β¦, name: str | None=β¦, include_in_schema: bool=β¦) -> Callable - changed:
method Router.url_path_for(name: str, /, **path_params: typing.Any) -> URLPath β method Router.url_path_for(name: str, /, **path_params: Any) -> URLPath - changed:
method Router.websocket_route(path: str, name: str | None=β¦) -> typing.Callable β method Router.websocket_route(path: str, name: str | None=β¦) -> Callable - changed:
method WebSocketRoute.url_path_for(name: str, /, **path_params: typing.Any) -> URLPath β method WebSocketRoute.url_path_for(name: str, /, **path_params: Any) -> URLPath
- changed:
class EndpointInfo(typing.NamedTuple) β class EndpointInfo(NamedTuple) - changed:
constructor SchemaGenerator(base_schema: dict[str, typing.Any]) -> None β constructor SchemaGenerator(base_schema: dict[str, Any]) -> None - changed:
field EndpointInfo.func: typing.Callable[..., typing.Any] β field EndpointInfo.func: Callable[..., Any] - changed:
method BaseSchemaGenerator.get_schema(routes: list[BaseRoute]) -> dict[str, typing.Any] β method BaseSchemaGenerator.get_schema(routes: list[BaseRoute]) -> dict[str, Any] - changed:
method BaseSchemaGenerator.parse_docstring(func_or_method: typing.Callable[..., typing.Any]) -> dict[str, typing.Any] β method BaseSchemaGenerator.parse_docstring(func_or_method: Callable[..., Any]) -> dict[str, Any] - changed:
method OpenAPIResponse.render(content: typing.Any) -> bytes β method OpenAPIResponse.render(content: Any) -> bytes - changed:
method SchemaGenerator.get_schema(routes: list[BaseRoute]) -> dict[str, typing.Any] β method SchemaGenerator.get_schema(routes: list[BaseRoute]) -> dict[str, Any]
- changed:
constructor Jinja2Templates(directory: str | PathLike[str] | typing.Sequence[str | PathLike[str]], *, context_processors: list[typing.Callable[[Request], dict[str, typing.Any]]] | None=β¦, **env_options: typing.Any) -> None | (*, env: jinja2.Environment, context_processors: list[typing.Callable[[Request], dict[str, typing.Any]]] | None=β¦) -> None β constructor Jinja2Templates(directory: str | PathLike[str] | Sequence[str | PathLike[str]], *, context_processors: list[Callable[[Request], dict[str, Any]]] | None=β¦, **env_options: Any) -> None | (*, env: jinja2.Environment, context_processors: list[Callable[[Request], dict[str, Any]]] | None=β¦) -> None - changed:
method Jinja2Templates.TemplateResponse(request: Request, name: str, context: dict[str, typing.Any] | None=β¦, status_code: int=β¦, headers: typing.Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> _TemplateResponse | (name: str, context: dict[str, typing.Any] | None=β¦, status_code: int=β¦, headers: typing.Mapping[str, str] | None=β¦, media_type: str | Noneβ¦ β method Jinja2Templates.TemplateResponse(request: Request, name: str, context: dict[str, Any] | None=β¦, status_code: int=β¦, headers: Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTask | None=β¦) -> _TemplateResponse | (name: str, context: dict[str, Any] | None=β¦, status_code: int=β¦, headers: Mapping[str, str] | None=β¦, media_type: str | None=β¦, background: BackgroundTaβ¦
- changed:
constructor TestClient(app: ASGIApp, base_url: str=β¦, raise_server_exceptions: bool=β¦, root_path: str=β¦, backend: typing.Literal['asyncio', 'trio']=β¦, backend_options: dict[str, typing.Any] | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, headers: dict[str, str] | None=β¦, follow_redirects: bool=β¦, client: tuple[str, int]=β¦) -> None β constructor TestClient(app: ASGIApp, base_url: str=β¦, raise_server_exceptions: bool=β¦, root_path: str=β¦, backend: Literal['asyncio', 'trio']=β¦, backend_options: dict[str, Any] | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, headers: dict[str, str] | None=β¦, follow_redirects: bool=β¦, client: tuple[str, int]=β¦) -> None - changed:
method TestClient.patch(url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: typing.Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDefault=β¦, folloβ¦ β method TestClient.patch(url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDefault=β¦, follow_redirβ¦ - changed:
method TestClient.post(url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: typing.Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDefault=β¦, followβ¦ β method TestClient.post(url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDefault=β¦, follow_redireβ¦ - changed:
method TestClient.put(url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: typing.Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDefault=β¦, follow_β¦ β method TestClient.put(url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDefault=β¦, follow_redirecβ¦ - changed:
method TestClient.request(method: str, url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: typing.Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDβ¦ β method TestClient.request(method: str, url: httpx._types.URLTypes, *, content: httpx._types.RequestContent | None=β¦, data: _RequestData | None=β¦, files: httpx._types.RequestFiles | None=β¦, json: Any=β¦, params: httpx._types.QueryParamTypes | None=β¦, headers: httpx._types.HeaderTypes | None=β¦, cookies: httpx._types.CookieTypes | None=β¦, auth: httpx._types.AuthTypes | httpx._client.UseClientDefault=β¦ - changed:
method TestClient.websocket_connect(url: str, subprotocols: typing.Sequence[str] | None=β¦, **kwargs: typing.Any) -> WebSocketTestSession β method TestClient.websocket_connect(url: str, subprotocols: Sequence[str] | None=β¦, **kwargs: Any) -> WebSocketTestSession - changed:
method WebSocketTestSession.receive_json(mode: typing.Literal['text', 'binary']=β¦) -> typing.Any β method WebSocketTestSession.receive_json(mode: Literal['text', 'binary']=β¦) -> Any - changed:
method WebSocketTestSession.send_json(data: typing.Any, mode: typing.Literal['text', 'binary']=β¦) -> None β method WebSocketTestSession.send_json(data: Any, mode: Literal['text', 'binary']=β¦) -> None
- changed:
async method WebSocket.accept(subprotocol: str | None=β¦, headers: typing.Iterable[tuple[bytes, bytes]] | None=β¦) -> None β async method WebSocket.accept(subprotocol: str | None=β¦, headers: Iterable[tuple[bytes, bytes]] | None=β¦) -> None - changed:
async method WebSocket.iter_bytes() -> typing.AsyncIterator[bytes] β async method WebSocket.iter_bytes() -> AsyncIterator[bytes] - changed:
async method WebSocket.iter_json() -> typing.AsyncIterator[typing.Any] β async method WebSocket.iter_json() -> AsyncIterator[Any] - changed:
async method WebSocket.iter_text() -> typing.AsyncIterator[str] β async method WebSocket.iter_text() -> AsyncIterator[str] - changed:
async method WebSocket.receive_json(mode: str=β¦) -> typing.Any β async method WebSocket.receive_json(mode: str=β¦) -> Any - changed:
async method WebSocket.send_json(data: typing.Any, mode: str=β¦) -> None β async method WebSocket.send_json(data: Any, mode: str=β¦) -> None