-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update HTTP headers #1644
Update HTTP headers #1644
Conversation
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.
LGTM 👍
For the record: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Pragma
@marjanovic93 could you please add a changelog entry? |
@nbulaj sure, updated! Back to you 🏓 |
I see some tests are failling, could you please check? And also squash all the commints into a single one later 🙏 Thanks! |
Pragma is a deprecated HTTP header. It changes from Cache-Control: no-store to Cache-Control: no-store, no-cache to Doorkeeper.
Sure @nbulaj 🚀 It should be fixed, your turn! 🏓 |
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.
All is good now, thanks 🙇
@@ -15,8 +15,7 @@ | |||
it "respond with correct headers" do | |||
post token_endpoint_url(code: @authorization.token, client: @client) | |||
|
|||
expect(headers["Pragma"]).to eq("no-cache") | |||
expect(headers["Cache-Control"]).to be_in(["no-store", "private, no-store"]) | |||
expect(headers["Cache-Control"]).to be_in(["no-store", "no-cache, no-store", "private, no-store"]) |
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.
Bit late here but, given that Pragma: no-cache
is always present here, would the equivalent not be:
expect(headers["Cache-Control"]).to be_in(["no-store, no-cache", "private, no-store, no-cache"])
Pragma is a deprecated HTTP header. It changes from Cache-Control: no-store to Cache-Control: no-store, no-cache to Doorkeeper.
Summary
Those headers are set by Doorkeeper. We have:
which are set in https://github.com/doorkeeper-gem/doorkeeper/search?q=no-cache
Pragma is a deprecated HTTP header and Atlassian's suggestion is what is favored now so we should contribute the simple change from
Cache-Control: no-store
toCache-Control: no-store, no-cache
to Doorkeeper and pick that up in a gem update.Other Information
If there's anything else that's important and relevant to your pull
request, mention that information here. This could include
benchmarks, or other information.
If you are updating CHANGELOG.md file or are asked to update it by reviewers,
please add the changelog entry at the top of the file.
Thanks for contributing to Doorkeeper project!