However `conditional_content_removal()` sets `Content-Type: 0` in these
cases:
https://github.com/django/django/blob/941b8691351d4739cd9391b0a1326abd0b1c29c0/django/test/client.py#L91-L108
...which is not compliant with the specification.
The fix is to not set `Content-Type` at all in
`conditional_content_removal()`.
Note: After #26052 `conditional_content_removal()` is only used by the
`django.test.client`, though that caused the regression #28054, for which
the fix will be making runserver use it too.
--
Ticket URL: <https://code.djangoproject.com/ticket/28081>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28081#comment:1>
* owner: nobody => João Silva
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/28081#comment:2>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8445 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28081#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"3db84b5526a16a136862381c6f8b08c59da4cb82" 3db84b55]:
{{{
#!CommitTicketReference repository=""
revision="3db84b5526a16a136862381c6f8b08c59da4cb82"
Fixed #28081 -- Stopped setting Content-Length=0 in
conditional_content_removal() per RFC 7230.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28081#comment:4>