Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

Custom CORS Headers #51

@brianhyder

Description

@brianhyder

We have a need to be able to modify the default CORS headers to support specific domains for the allowed origin. We'd prefer to avoid having to add these headers in each handler or as middleware, if possible.

A possible solution:
Allow for a handler (anonymous function or arrow function) to be assigned to the cors variable or another variable in the proxy configuration. That handler would be responsible for setting the header values as shown here or return an object with the key values that could be merged with the other headers.

This would allow for the handy option, to handle all OPTIONS requests, to stay in place but provide a greater level of customization for each use-case. The default behavior could be to use the existing function that sets the headers if no implementation is provided.

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