Currently, Gunicorn forwards 204 and 304 responses even when the app includes a non-zero Content-Length
or a body.
According to RFC 9112 , these responses must not include a message body, and Content-Length
must be absent or zero.
Expected behavior
For 1xx, 204, 304 responses (and HEAD requests):
- Any response body should be ignored or dropped.
Content-Length
should be removed.
Actual behavior
Gunicorn sends the body and headers as provided by the WSGI app, even when they violate the spec.