106:    async def app(scope: Scope, receive: Receive, send: Send) -> None:
109:        async def app(scope: Scope, receive: Receive, send: Send) -> None:
145:    async def app(scope: Scope, receive: Receive, send: Send) -> None:
148:        async def app(scope: Scope, receive: Receive, send: Send) -> None:
344:    return response_args
347:def get_request_handler(
378:    async def app(request: Request) -> Response:
612:                response.headers["Cache-Control"] = "no-cache"
614:                response.headers["X-Accel-Buffering"] = "no"
615:                response.headers.raw.extend(solved_result.response.headers.raw)
648:                response.headers.raw.extend(solved_result.response.headers.raw)
668:                response.headers.raw.extend(solved_result.response.headers.raw)
714:                    response.headers.raw.extend(solved_result.response.headers.raw)
723:        return response
733:    async def app(websocket: WebSocket) -> None:
4072:            response.headers["X-Cat-Dog"] = "Alone in the world"
from starlette.middleware import Middleware as Middleware
import contextlib
import email.message
import functools
import inspect
import json
import types
from collections.abc import (
    AsyncIterator,
    Awaitable,
    Callable,
    Collection,
    Coroutine,
    Generator,
    Iterator,
    Mapping,
    Sequence,
)
from contextlib import (
    AbstractAsyncContextManager,
    AbstractContextManager,
    AsyncExitStack,
    asynccontextmanager,
)
from enum import Enum, IntEnum
from typing import (
    Annotated,
    Any,
    TypeVar,
)

import anyio
from annotated_doc import Doc
from anyio.abc import ObjectReceiveStream
from fastapi import params
from fastapi._compat import (
    ModelField,
    Undefined,
    lenient_issubclass,
)
from fastapi.datastructures import Default, DefaultPlaceholder
from fastapi.dependencies.models import Dependant
from fastapi.dependencies.utils import (
    _should_embed_body_fields,
    get_body_field,
    get_dependant,
    get_flat_dependant,
    get_parameterless_sub_dependant,
    get_stream_item_type,
    get_typed_return_annotation,
    solve_dependencies,
)
from fastapi.encoders import jsonable_encoder
from fastapi.exceptions import (
    EndpointContext,
    FastAPIError,
    RequestValidationError,
    ResponseValidationError,
    WebSocketRequestValidationError,
)
from fastapi.sse import (
    _PING_INTERVAL,
    KEEPALIVE_COMMENT,
    EventSourceResponse,
    ServerSentEvent,
    format_sse_event,
)
from fastapi.types import DecoratedCallable, IncEx
from fastapi.utils import (
    create_model_field,
    generate_unique_id,
    get_value_or_default,
    is_body_allowed_for_status_code,
)
from starlette import routing
from starlette._exception_handler import wrap_app_handling_exceptions
from starlette._utils import is_async_callable
from starlette.concurrency import iterate_in_threadpool, run_in_threadpool
from starlette.exceptions import HTTPException
from starlette.requests import Request
from starlette.responses import JSONResponse, Response, StreamingResponse
from starlette.routing import (
    BaseRoute,
    Match,
    compile_path,
    get_name,
)
from starlette.routing import Mount as Mount  # noqa
from starlette.types import AppType, ASGIApp, Lifespan, Receive, Scope, Send
from starlette.websockets import WebSocket
from typing_extensions import deprecated
