Project

General

Profile

Bug #13582

RGW should not send a Content-Length header with a 204 response

Added by Wido den Hollander almost 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
civetweb,rgw,varnish
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Currently RGW (with Civetweb) responds with a 'Content-Length: 0' header on a DELETE.

204 OK HTTP/1.1
Content-Length: 0

This causes a backend error with for example the Varnish proxy since the Content-Length header is not allowed on a 204 response.

RFC7230 says:

A server MUST NOT send a Content-Length header field in any response with a status code of 1xx (Informational) or 204 (No Content).

We should not send a Content-Length header when the response-code is 1xx or 204 since no Content is being send.

Associated revisions

Revision 4e5921db (diff)
Added by Wido den Hollander almost 6 years ago

rgw: Do not send a Content-Length header on status 204

RFC7230 says:
A server MUST NOT send a Content-Length header field in any response with a
status code of 1xx (Informational) or 204 (No Content).

Fixes: #13582

Revision ceb8e190 (diff)
Added by Wido den Hollander over 5 years ago

rgw: Do not send a Content-Length header on status 204

RFC7230 says:
A server MUST NOT send a Content-Length header field in any response with a
status code of 1xx (Informational) or 204 (No Content).

Fixes: #13582
Signed-off-by: Wido den Hollander <>
(cherry picked from commit 4e5921dbc7d1c51feb4cc5c03aa59a432742765e)

History

#1 Updated by Ken Dreyer almost 6 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF