Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
mjarosie opened this issue Apr 21, 2023 · 1 comment

Comments

@mjarosie
Copy link

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

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
@pilotmoon
Copy link

pilotmoon commented Dec 11, 2023

To set no Access-Control headers at all in the response, return an empty string "" from the options.origin function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants