-
Notifications
You must be signed in to change notification settings - Fork 190
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
Default charset does not apply to JSON responses #298
Comments
It appears that As far as the charset, you can see the linked issues from @ztane to understand that 1.7 explicitly changes this behavior in webob with regard to |
Like so:
When passing JSON, I would recommend:
Or
|
Automatically adds the default charset:
Which allows you to set
I'd rather that raise an error than silently setting the body. WebOb 1.6.x treats This meant there was inconsistent handling, for example:
|
Ok I understand. Thanks for clearing this up for me - and sorry for missing the existing issues. |
I've documented this better in: http://docs.webob.org/en/1.7-branch/whatsnew-1.7.html#backwards-incompatibility as well documenting it in http://docs.webob.org/en/1.7-branch/api/response.html#webob.response.Response Hopefully this will help other users that may run into the same issue. |
I've tested WebOb 1.7rc1 with Morepath and I've noticed that the default UTF-8 charset of the response only applies to text responses:
Now I have no problem setting the charset of JSON responses explicitly (and as of today Morepath does), but I was wondering if this might be a bug.
I would have expected that the JSON response also uses the default charset defined on the Response class.
The text was updated successfully, but these errors were encountered: