You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We found that by default Express adds the utf-8 charset by default to the Content-Type string. But does it always make sense? The W3C spec says:
Documents transmitted with HTTP that are of type text, such as text/html, text/plain, etc., can send a charset parameter in the HTTP header to specify the character encoding of the document.
However, sometimes people use Content-Typewhich are not text based, like application/... and in their cases, it probably not blindly add charset:utf-8.
The text was updated successfully, but these errors were encountered:
We do this to protect you from certain attacks. If you don't want it added, then either don't use res.send or give res.send a Buffer instead of a string (since Buffer is not text and a string is text).
We found that by default Express adds the utf-8 charset by default to the Content-Type string. But does it always make sense? The W3C spec says:
However, sometimes people use
Content-Type
which are not text based, likeapplication/...
and in their cases, it probably not blindly addcharset:utf-8
.The text was updated successfully, but these errors were encountered: