-
Notifications
You must be signed in to change notification settings - Fork 26
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
Don't respond to OPTIONS requests for non-oauth requests #539
Conversation
This middleware is a little overzealous with its responses to `OPTIONS` requests. It really shouldn't respond to *every* request with these default highly permissive CORS headers. Instead, it should only respond in this way if the path matches the prefix, otherwise defer to the application to respond to the `OPTIONS` request with its own CORS headers.
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
|
I think we need to add a test to avoid future regression. Could you look into that? |
Great idea! Added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR, thank you Tyler 💐
🎉 This PR is included in version 7.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This middleware is a little overzealous with its responses to
OPTIONS
requests. It really shouldn't respond to every request with these default highly permissive CORS headers.Instead, it should only respond in this way if the path matches the prefix, otherwise defer to the application to respond to the
OPTIONS
request with its own CORS headers.Before the change?
OPTIONS calls to any API result in the headers defined by the
oauth-app.js
library.After the change?
OPTIONS calls to any API result in headers defined by the application.
And OPTIONS calls to this middleware's routes still return correct headers:
Pull request checklist
Does this introduce a breaking change?
Low probability