Skip to content

Support for CORS preflight #3497

@danielrohe

Description

@danielrohe

Is your feature request related to a problem? Please describe.

Currently skipper only supports setting the CORS origin on the response but CORS also requires a preflight request (OPTIONS request) in certain cases (non form-based requests). I want skipper to handle CORS preflight requests.

Describe the solution you would like

The solution should provide a skipper filter corsPreflight similar to the corsOrigin filter. The corsPreflight filter should be configurable allowing users to set the response headers Access-Control-Allow-Origin, Access-Control-Allow-Methods and Access-Control-Allow-Headers. If they are not set meaningful defaults are used, i.e. Access-Control-Allow-Origin = *, Access-Control-Allow-Methods = GET, POST, PUT, DELETE, PATCH, OPTIONS and Access-Control-Allow-Headers = *.

The filter should only work on requests with method OPTIONS. When executed the filter should set the response headers as configured and the status to 200 and return this response. It should not forward the request to the backend.

Would you like to work on it?

Yes, but no time.

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