Closed dkullmann closed 8 years ago
@dkullmann the way I read the code is if status is set cuba does not touch the content-type or the otherway around if you set the status you also need to set the content-type
sounds fair to me.
There's an experimental feature in master that may alleviate this problem. Instead of only setting the status code to 404, Cuba calls the not_found
method, which by default only sets the status code to 404. With this change, it is now possible to redefine not_found
so it can set the headers and body in case of a 404.
Closing this issue as the not_found
hook landed on version 3.5.0. Let me know if it needs to be reopened.
The
Content-Type
isn't being set when a404
occurs on our application, which means that plain text is rendered: http://cl.ly/image/1f401k340S29Is this the intended default behavior?
I believe that the way it works is all 200's have a default
Content-Type
oftext/html
if not otherwise set, but other status codes have noContent-Type
at all (see here)