Pylons / Pylons/webob

add a way to tell if the content type has changed on the response

Open
#204 5 comments 0 reactions 1 assignee View on GitHub

@digitalresistor is already working on this.

Since Jul 30, 2016.

feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.