add a way to tell if the content type has changed on the response
@digitalresistor is already working on this.
Since Jul 30, 2016.
- Dominant language
- Python
- Stars
- 443
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
In Pyramid our renderers attempt to change the content_type of the response object to a sane default if and only if the user has not changed it themselves. We've traditionally used if response.content_type == response.default_content_type where the default_content_type == 'text/html' however in some cases we've found the user attempting to override a renderer like the string renderer to return text/html. In this case the user sets response.content_type = 'text/html' and the string renderer sees no changes and overrides it to text/plain.
TLDR A way to tell if the content_type was set.
Related: https://github.com/Pylons/pyramid/pull/1565 and https://github.com/Pylons/pyramid/issues/1344
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.