You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
I'd rather not return any allowed domains to the caller if the caller is not allowed to call my API in the first place as it might undisclose details unnecessarily.
Returning a null is not a good practice because of security issues as described in this issue.
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
I have searched through GitHub issues for similar issues.
I have completely read through the README and documentation.
The text was updated successfully, but these errors were encountered:
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:false/undefined
fromorigin
function causes the middleware to be completely ignored which seems to be a feature of this library as there's a unit test that proves this behaviour.null
is not a good practice because of security issues as described in this issue.If the request
Origin
is not allowed, the middleware should be able to respond to pre-flight requests immediately with noAccess-Control
headers being returned at all.Checklist
The text was updated successfully, but these errors were encountered: