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

Set encoding to utf-8 for JSON response #302

Merged
merged 5 commits into from Sep 12, 2017

Conversation

floatdrop
Copy link
Contributor

@floatdrop floatdrop commented Aug 26, 2017

Part of #301

@floatdrop
Copy link
Contributor Author

@leo bump.

lib/index.js Outdated
@@ -69,7 +69,7 @@ const send = (res, code, obj = null) => {
}

if (!res.getHeader('Content-Type')) {
res.setHeader('Content-Type', 'application/json')
res.setHeader('Content-Type', 'application/json; encoding=utf-8')
Copy link

Choose a reason for hiding this comment

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

I think this should be charset=utf-8 instead of encoding=utf-8 by RFC2068 and the official w3 article.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, right! Thanks!

@leo leo merged commit ad9a5d3 into vercel:master Sep 12, 2017
@leo
Copy link
Contributor

leo commented Sep 12, 2017

@floatdrop Thank you!

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.

None yet

3 participants