Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: Make backend handle URLs with trailing slash #1059

Merged
merged 1 commit into from
Aug 7, 2024

Commits on Aug 7, 2024

  1. misc: Make backend handle URLs with trailing slash

    According to multiple FastAPI discussions [1], FastAPI only includes a
    built-in mechanism to redirect requests including a trailing slash, to
    its variation without slash, using a `307` status code.
    
    This can be an issue when certain clients do not send the same headers
    on the redirected request.
    
    This change adds a custom FastAPI `APIRouter`, that registers both route
    path variations (with and without trailing slash), while only marking
    the path without slash for being included in the OpenAPI schema.
    
    [1] fastapi/fastapi#7298
    adamantike committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    8abbae4 View commit details
    Browse the repository at this point in the history