Skip to content

Change reccomendation of applying middleware #104

@fraser-langton

Description

@fraser-langton

change to:

from fastapi import FastAPI

from asgi_correlation_id import CorrelationIdMiddleware

fastapi_app = FastAPI()
app = CorrelationIdMiddleware(fastapi_app)

I think this aligns better with expected behaviour (imo not returning correlation id on 500s is no expected).

I see you have a section to alleviate this behaviour but I think it should be default behaviour - also it feels a little cleaner just applying it once and not having to replicate the logic in a exc handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions