Project

General

Profile

Actions

Bug #19965

open
SM

RGW handling of combined If-None-Match and If-Modified-Since request is not RFC compliant

Bug #19965: RGW handling of combined If-None-Match and If-Modified-Since request is not RFC compliant

Added by Sylvain Munaut over 9 years ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

If you look at the rfc2616 (section 14.26), my interpretation is that is that the result should be as follow :

If-None-Match   If-modified-since       RV
----------------------------------------------
Not Present     Not present             200
Not Present     Same or older           304
Not Present     Newer                   200
No Match        Not present             200
No Match        Same or older           200     <---
No Match        Newer                   200
Match           Not present             304
Match           Same or older           304
Match           Newer                   200     <---

The two highlighted case seem incorrect to me when reading the code ( src/rgw/rgw_rados.cc around line 9297 ) the two headers are processed completely independently and so the 'weird' interactions between the two are not properly accounted for.

Specifically the RFC says :

   If any of the entity tags match the entity tag of the entity that
   would have been returned in the response to a similar GET request
   (without the If-None-Match header) on that resource, or if "*" is
   given and any current entity exists for that resource, then the
   server MUST NOT perform the requested method, unless required to do
   so because the resource's modification date fails to match that
   supplied in an If-Modified-Since header field in the request.

and

   If none of the entity tags match, then the server MAY perform the
   requested method as if the If-None-Match header field did not exist,
   but MUST also ignore any If-Modified-Since header field(s) in the
   request. That is, if no entity tags match, then the server MUST NOT
   return a 304 (Not Modified) response.

GF Updated by Greg Farnum over 9 years ago Actions #1

  • Project changed from Ceph to rgw
  • Category deleted (22)

RN Updated by Ramin Najarbashi about 1 month ago Actions #2

The If-None-Match + If-Modified-Since rows in the description behave correctly on main (5ab2b0ddb70).

The remaining case (failing If-Match together with If-Modified-Since answered 304 instead of 412) is fixed in #82233 / https://github.com/ceph/ceph/pull/73205.

Actions

Also available in: PDF Atom