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

add charset UTF-8 to template exception #28

Merged
merged 5 commits into from
Oct 28, 2015
Merged

Conversation

uralbash
Copy link
Contributor

before:
_262

after:
_261

@asvetlov
Copy link
Member

I believe it's better solved by specifying correct content type for responses.
Also all rendered pages requires utf-8 perhaps.

@jettify
Copy link
Member

jettify commented Oct 26, 2015

hm, could we get rid from <meta charset="UTF-8" /> in templates? Specified content type should be enough

@uralbash
Copy link
Contributor Author

@jettify Well, I removed it. If it is clear why this is necessary, you can always add

response = web.Response(body=body, status=500)
response = web.Response(
body=body, status=500,
content_type='text/html; charset=utf-8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch is wrong, sorry.

content_type parameter is for type only, not charset.
Ctor adds ; charset=utf-8 to given parameter ultimately: https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/web_reqrep.py#L742-L748

content_type='text/html' should be enough.

Perhaps we need charset param for aiohttp.web.Response ctor, I'll file the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asvetlov Thanks for clarification

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