Skip to content

Set encoding to utf-8 for JSON response#302

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

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

Conversation

@floatdrop

@floatdrop floatdrop commented Aug 26, 2017

Copy link
Copy Markdown
Contributor

Part of #301

@floatdrop

Copy link
Copy Markdown
Contributor Author

@leo bump.

Comment thread 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
Copy Markdown

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
Copy Markdown
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

leo commented Sep 12, 2017

Copy link
Copy Markdown
Contributor

@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