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

Don't incorrectly default charset on FileResponse #1251

Merged
merged 3 commits into from
May 17, 2014

Conversation

dobesv
Copy link
Contributor

@dobesv dobesv commented Feb 28, 2014

By passing the content_type into the constructor to Response, we can allow it to decide intelligently whether the default charset should apply. Otherwise we'd have to replicate that logic somehow, or live with weird charset annotations on images, pdfs, and zips.

By passing the content_type into the constructor to Response, we can allow it to decide intelligently whether the default charset should apply.  Otherwise we'd have to replicate that logic somehow, or live with weird charset annotations on images, pdfs, and zips.
@mmerickel
Copy link
Member

I'm not sure on the rationale behind adding this as a function versus just moving the lines up a bit and passing the options into __init__ but either way it needs to follow the 79-character limit and come with some tests demonstrating the problem it is solving.

@dobesv
Copy link
Contributor Author

dobesv commented Mar 7, 2014

I think my mind was affected by java where you cannot have any code before the super call. Sorry about that.

I'll clean it up and add a unit test sometime.

@dobesv
Copy link
Contributor Author

dobesv commented Mar 7, 2014

OK I made the changes you requested, please let me know if there's anything more to do.

@digitalresistor
Copy link
Member

👍 LGTM.

@mmerickel mmerickel merged commit 06c127e into Pylons:1.5-branch May 17, 2014
@mmerickel
Copy link
Member

Great stuff, I fixed up some line endings and a resource warning. Thanks for the PR!

@mmerickel
Copy link
Member

I've updated the changelog and forward-ported this onto master as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants