Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: default body encoding #287

Merged
merged 2 commits into from Oct 1, 2016
Merged

Conversation

@bertjwregeer
Copy link
Member

@bertjwregeer bertjwregeer commented Sep 30, 2016

Pyramid uses .text in it's renderers, however with the changes made to remove charset when there is no charset on the content-type, this meant that things would break.

Instead add a new default_body_encoding to Response that may be used as the alternative to charset. This will allow .text to continue functioning.

It's a small backwards incompatible change, but if you were relying on WebOb to complain about no charset being set when accessing .text I'd love to have a word with you :-).

Closes #271

@bertjwregeer
Copy link
Member Author

@bertjwregeer bertjwregeer commented Sep 30, 2016

@mmerickel This one's for you!

This is mainly used to allow users to continue using .text even with
Content-Types that don't have a charset.

Looking at you Pyramid...
@bertjwregeer bertjwregeer force-pushed the feature/default_body_encoding branch from 867c800 to 99c3e76 Sep 30, 2016
Copy link
Member

@mmerickel mmerickel left a comment

This is a good best-effort feature to keep the body accessible as text.

LGTM

@bertjwregeer bertjwregeer merged commit 7414d49 into master Oct 1, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@bertjwregeer bertjwregeer deleted the feature/default_body_encoding branch Oct 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants