-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Issue Description
Using application/json; charset=UTF-8
in response header is a common misuse. I think it is better to remove ; charset=UTF-8
from default json response Content-Type header to prevent the misconception.
According to the documentation at rfc8259: JSON spec, JSON has only one encoding type, 'UTF-8'. JSON must be encoded by UTF-8, and there is no "charset" parameter.
The media type for JSON text is application/json.
...
Note: No "charset" parameter is defined for this registration. Adding one really has no effect on compliant recipients.
8.1. Character Encoding
JSON text exchanged between systems that are not part of a closed
ecosystem MUST be encoded using UTF-8 [RFC3629].
Checklist
- Dependencies installed
- No typos
- Searched existing issues and docs
Expected behaviour
In response header:
Content-Type: application/json
Actual behaviour
Content-Type: application/json; charset=UTF-8
Steps to reproduce
any response when to response with JSON(code int, i interface{}),
default response Content-Type header contains ; charset=UTF-8
.
Version/commit
v4.11.4
smallfish06, dohyeunglee and trungdlp-wolffun
Metadata
Metadata
Assignees
Labels
No labels