Skip to content

Included value of Accept header in Vary header generated for get requ… - #3516

Merged
hughrun merged 1 commit into
bookwyrm-social:mainfrom
timothyjrogers:add-accept-header-value-to-vary-header-when-relevant
Mar 16, 2025
Merged

Included value of Accept header in Vary header generated for get requ…#3516
hughrun merged 1 commit into
bookwyrm-social:mainfrom
timothyjrogers:add-accept-header-value-to-vary-header-when-relevant

Conversation

@timothyjrogers

Copy link
Copy Markdown
Contributor

…ests with differing behaviors based on Accept

Description

This pull request adds the value of the HTTP Accept header to the generated Vary header for GET requests that behave differently based on the value of Accept -- generally pages that return HTML or JSON based on the value of Accept. This is in support of external caching in front of Nginx, as described in #3512 .

I did not modify the Vary header behavior for any POST endpoints because I am not familiar enough to know which are idempotent.

What type of Pull Request is this?

  • Bug Fix
  • Enhancement
  • Plumbing / Internals / Dependencies
  • Refactor

Does this PR change settings or dependencies, or break something?

  • This PR changes or adds default settings, configuration, or .env values
  • This PR changes or adds dependencies
  • This PR introduces other breaking changes

Details of breaking or configuration changes (if any of above checked)

Documentation

  • New or amended documentation will be required if this PR is merged
  • I have created a matching pull request in the Documentation repository
  • I intend to create a matching pull request in the Documentation repository after this PR is merged

Tests

  • [x ] My changes do not need new tests
  • All tests I have added are passing
  • I have written tests but need help to make them pass
  • I have not written tests and need help to write them

…ests with differing behaviors based on Accept
@hughrun

hughrun commented Mar 16, 2025

Copy link
Copy Markdown
Member

Thankyou!

@hughrun
hughrun merged commit f3bd5c6 into bookwyrm-social:main Mar 16, 2025
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.

Vary header should include Accept if a resource can be HTML and JSON

2 participants