Skip to content

Add support for CORS preflight requests #628

@piptouque

Description

@piptouque

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.
Currently, requests from a browser application (for instance, using xapi.js) are blocked because the client application sends preflight requests before every other request (GET /xAPI/statements etc.).
Ralph does not handle preflight request because CORS is not enabled on the FastAPI side of things.

Describe the solution you'd like
Use FastAPI's CORSMiddleware to handle preflight requests.

Describe alternatives you've considered
CORS could also be handled by a proxy server (such as nginx running as a reverse proxy for Ralph). This requires modifying the proxy's host config for Ralph, and seems a bit boilerplate to me.

Discovery, Documentation, Adoption, Migration Strategy
There should be no change to otherwise working features.

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