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

Update HTTP headers #1644

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Update HTTP headers #1644

merged 1 commit into from
Mar 16, 2023

Conversation

boimw
Copy link

@boimw boimw commented Mar 13, 2023

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:

Pragma: no-cache
Cache-Control: no-store

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 to Cache-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!

Copy link
Member

@nbulaj nbulaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nbulaj
Copy link
Member

nbulaj commented Mar 14, 2023

@marjanovic93 could you please add a changelog entry?

@boimw
Copy link
Author

boimw commented Mar 14, 2023

@nbulaj sure, updated! Back to you 🏓

@nbulaj
Copy link
Member

nbulaj commented Mar 15, 2023

I see some tests are failling, could you please check? And also squash all the commints into a single one later 🙏 Thanks!
https://github.com/doorkeeper-gem/doorkeeper/actions/runs/4414282695/jobs/7770367021

Pragma is a deprecated HTTP header. It changes from Cache-Control:
no-store to Cache-Control: no-store, no-cache to Doorkeeper.
@boimw
Copy link
Author

boimw commented Mar 15, 2023

Sure @nbulaj 🚀

It should be fixed, your turn! 🏓

Copy link
Member

@nbulaj nbulaj left a 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 🙇

@nbulaj nbulaj merged commit cbaf026 into doorkeeper-gem:main Mar 16, 2023
@@ -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"])
Copy link

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"])

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

Successfully merging this pull request may close these issues.

None yet

4 participants