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

Description
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.