Content-Type header present when responding with 204
See original GitHub issue-
I’m submitting a … [ X ] bug report [ ] feature request [ ] question about the decisions made in the repository
-
Do you want to request a feature or report a bug?
Bug
- What is the current behavior?
When setting the response status via cherrypy.response.status
to 204
the Content-Type header is still present.
- What is the expected behavior?
No Content-Type header when there is no content with a 204 status code
- What is the motivation / use case for changing the behavior?
Some clients and test frameworks (i.e WebTest: https://pypi.python.org/pypi/WebTest) will error when there is a Content-Type with status code 204.
- Please tell us about your environment:
- Cheroot version: 5.8.3
- CherryPy version: 11.0.0
- Python version: 3.6.2
- OS: Windows 10
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
What Content-Type should a 204 No Response use?
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. (from RFC2616, § ...
Read more >204 No Content - HTTP - MDN Web Docs - Mozilla
The HTTP 204 No Content success status response code indicates that a request has succeeded, but that the client doesn't need to navigate...
Read more >Responses of 204 ignore contentType and incorrectly fail ...
While not required, and somewhat meaningless, the ContentType header of 204 (No Content) responses are ignored, and assumed to be the empty ...
Read more >Understanding HEAD, HTTP/204 and HTTP/206 - Telerik
The behavior changes in the event that a user is navigating a browser window or an frame/iframe.
Read more >HTTP/1.1: Status Code Definitions
The 204 response MUST NOT include a message-body, and thus is always terminated by the ... If a Content-Length header field is present...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yup looks good in cheroot 6 and cherrypy 13.1
Cool, thanks for checking. I’ve also noticed that we actually have a test for this: https://github.com/cherrypy/cheroot/blob/5bc7b39/cheroot/test/test_conn.py#L579-L584 (JFI)