Skip to content

[API] Ignore If-Modified-Since when If-None-Match is present#330

Open
RedZapdos123 wants to merge 1 commit into
rage-rb:mainfrom
RedZapdos123:fix/if-modified-since-precedence-329
Open

[API] Ignore If-Modified-Since when If-None-Match is present#330
RedZapdos123 wants to merge 1 commit into
rage-rb:mainfrom
RedZapdos123:fix/if-modified-since-precedence-329

Conversation

@RedZapdos123

@RedZapdos123 RedZapdos123 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description:

Issue #329 reported that Rage still evaluated If-Modified-Since when If-None-Match was present, so an older If-Modified-Since could force a 200 OK even when If-None-Match already matched.

This PR updates Rage::Request#fresh? to give If-None-Match precedence when it is present and only fall back to If-Modified-Since when no If-None-Match header is sent.

It also adds regression tests for the matching If-None-Match + stale If-Modified-Since case and for the path where the response only sets an ETag.

Closes #329.

Checklist:

  • I have added relevant regression test cases for this fix.
  • I have run linting checks in WSL using bundle exec rubocop --except Layout/EndOfLine lib/rage/request.rb spec/controller/api/conditional_get_spec.rb.
  • I have run focused tests in WSL using bundle exec rspec spec/controller/api/conditional_get_spec.rb.
  • I have run broader regression checks in WSL using bundle exec rspec spec/controller/api.

Before the fix:

image

After the fix:

image

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
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.

[API] Ignore If-Modified-Since when If-None-Match is present

2 participants