Skip to content

middleware

titiler.core.middleware

Titiler middlewares.

CacheControlMiddleware

MiddleWare to add CacheControl in response headers.

__call__ async

__call__(scope: Scope, receive: Receive, send: Send)

Handle call.

__init__

__init__(
    app: ASGIApp,
    cachecontrol: Optional[str] = None,
    cachecontrol_max_http_code: Optional[int] = 500,
    exclude_path: Optional[Set[str]] = None,
) -> None

Init Middleware.

Parameters:

  • app (ASGIApp) –

    starlette/FastAPI application.

  • cachecontrol (str, default: None ) –

    Cache-Control string to add to the response.

  • exclude_path (set, default: None ) –

    Set of regex expression to use to filter the path.

LoggerMiddleware

MiddleWare to add logging.

__call__ async

__call__(scope: Scope, receive: Receive, send: Send)

Handle call.

__init__

__init__(app: ASGIApp, querystrings: bool = False, headers: bool = False) -> None

Init Middleware.

Parameters:

  • app (ASGIApp) –

    starlette/FastAPI application.

LowerCaseQueryStringMiddleware

Middleware to make URL parameters case-insensitive. taken from: tiangolo/fastapi#826

__call__ async

__call__(scope: Scope, receive: Receive, send: Send)

Handle call.

__init__

__init__(app: ASGIApp) -> None

Init Middleware.

Parameters:

  • app (ASGIApp) –

    starlette/FastAPI application.

TotalTimeMiddleware

MiddleWare to add Total process time in response headers.

__call__ async

__call__(scope: Scope, receive: Receive, send: Send)

Handle call.

__init__

__init__(app: ASGIApp) -> None

Init Middleware.

Parameters:

  • app (ASGIApp) –

    starlette/FastAPI application.