question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rmb938commented, Dec 17, 2017

Yup looks good in cheroot 6 and cherrypy 13.1

0reactions
webknjazcommented, Dec 22, 2017

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found