cors icon indicating copy to clipboard operation
cors copied to clipboard

Allow not returning any access control headers if the Origin is not allowed to access the resource

Open mjarosie opened this issue 1 year ago • 1 comments

Describe the feature

At the moment the library does not allow handling the scenario in which the origin is not allowed to access the resource: it expects options. origin to always return a string. That leads to developers having to come up with a "workaround" configuration (for example here or here) which is not ideal:

If the request Origin is not allowed, the middleware should be able to respond to pre-flight requests immediately with no Access-Control headers being returned at all.

Checklist

  • [x] I have searched through GitHub issues for similar issues.
  • [x] I have completely read through the README and documentation.

mjarosie avatar Apr 21 '23 15:04 mjarosie