Skip to content

Comments

Set encoding to utf-8 for JSON response#302

Merged
leo merged 5 commits intovercel:masterfrom
floatdrop:default-utf8-charset
Sep 12, 2017
Merged

Set encoding to utf-8 for JSON response#302
leo merged 5 commits intovercel:masterfrom
floatdrop:default-utf8-charset

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

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.

3 participants