Content type of default error pages should be always "text/html"
|Reported by:||lvella||Owned by:||anonymous|
|Cc:||timograham@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have in my settings.py:
DEFAULT_CONTENT_TYPE = 'application/xhtml+xml'
And every view defined in the project conforms to the that. For instance, I have defined a custom 404 error page, and there is no issue, because I wrote it as valid XHTML.
The problem is that the default error pages that comes in Django are, too, being served with the content type I choose in my settings. The simple default error 500 page content "<h1>Server Error (500)</h1>" is being server as XHTML, what is obviously wrong and fails to render in the browsers.
Default error pages should use specific content type for what it its, in this case, text/html, for the case the default content type has been overridden.
Change History (9)
comment:1 Changed 3 years ago by
|Component:||Uncategorized → HTTP handling|
|Triage Stage:||Unreviewed → Accepted|
comment:5 Changed 3 years ago by
|Patch needs improvement:||set|
|Triage Stage:||Ready for checkin → Accepted|
comment:6 Changed 3 years ago by
|Patch needs improvement:||unset|
comment:7 Changed 3 years ago by
|Owner:||changed from jimmysong to anonymous|
|Triage Stage:||Accepted → Ready for checkin|