Fix #63507
closed304 response is not RFC9110 compliant
0%
Description
When returning 304 (NotModified) both s3 and s3website endpoints violates RFC9110 (https://www.rfc-editor.org/rfc/rfc9110.html#name-304-not-modified) which states:
The server generating a 304 response MUST generate any of the following header fields that would have been sent in a 200 (OK) response to the same request:
Content-Location, Date, ETag, and Vary
Cache-Control and Expires (see [CACHING])
But at the moment the rgw returns only Date, Connection, and x-amz-request-id. Missing Etag and other headers. This leads to problems, especially with caching of the content.
When I tested this on AWS S3 they add all user-added headers to the 304 response so there is no check to include only some headers.
This Issue was already fixed in this PR from 2020 but I'm not sure if the code is up to date.
Here is a request-response comparison.
HTTP/1.1 200 OK
Date: Wed, 08 Nov 2023 20:49:34 GMT
Content-Type: application/json
Content-Length: 219814
Connection: keep-alive
Vary: Accept-Encoding
Last-Modified: Wed, 08 Nov 2023 14:09:57 GMT
x-rgw-object-type: Normal
ETag: "4c798420d279a49c53362ce7fe02b5a1"
Cache-Control: s-maxage=600, max-age=600
x-amz-request-id: tx0000015db8ba6a9ed2b58-00987bf45e-2bb0e72-tst
Accept-Ranges: bytes
HTTP/1.1 304 Not Modified
Date: Wed, 08 Nov 2023 20:51:30 GMT
Connection: keep-alive
x-amz-request-id: tx00000ada6318cbd67f76b-00987bf4d2-2bb0e72-tst
Updated by Ondrej Kukla 6 months ago
Here is a link for the PR mentioned - https://github.com/ceph/ceph/pull/35284
Updated by Casey Bodley 6 months ago
- Is duplicate of Bug #45736: rgw: lack of headers in 304 response added
Updated by Casey Bodley 6 months ago
- Project changed from Ceph to rgw
- Status changed from New to Duplicate
thanks, i revived the original fix from https://tracker.ceph.com/issues/45736. we'll track progress there since it's linked to the prs