From fe36f5ab86ff70b1b358892efae3b4b586a1b285 Mon Sep 17 00:00:00 2001 From: Mark Nottingham Date: Tue, 9 Jun 2026 14:05:42 +1000 Subject: [PATCH] Make conditional-etag-precedence actually test precedence Both conditionals evaluated to 304, so any evaluation order passed and a cache that ignored If-None-Match precedence was not caught. Move If-Modified-Since before Last-Modified so it alone would yield 200, while If-None-Match still yields 304; only a cache that honours the If-None-Match precedence (RFC 9110 13.2.2) returns the expected 304. Closes #169 Co-Authored-By: Claude Opus 4.8 --- tests/conditional-etag.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/conditional-etag.mjs b/tests/conditional-etag.mjs index 31ff931..97b05f3 100644 --- a/tests/conditional-etag.mjs +++ b/tests/conditional-etag.mjs @@ -65,9 +65,14 @@ export default { ] }), { + // The two conditionals are intentionally in disagreement: the + // matching `If-None-Match` yields 304, whereas `If-Modified-Since` + // is set before `Last-Modified` (-10000 vs -5000) so on its own it + // would yield 200. Only a cache that gives `If-None-Match` + // precedence returns the expected 304. request_headers: [ ['If-None-Match', '"abcdef"'], - ['If-Modified-Since', -1] + ['If-Modified-Since', -10000] ], magic_ims: true, expected_type: 'cached',