expressjs / expressjs/expressjs.com
Possible gap in documentation re res.json and res.jsonp
Open
docs
question
- Dominant language
- MDX
- Stars
- 5.4k
- Forks
- 2.3k
- Avg merge
- 2d 23m
- Merged PRs (30d)
- 14
Description
The documentation for 4.x, under res.jsonp() says, "res.jsonp([body])
Sends a JSON response with JSONP support. This method is identical to res.json(), except that it opts-in to JSONP callback support."
It appears that part of res.jsonp involves changing the content-type from 'application/json' to 'text/javascript'. I understand why this happens (RFC JSON Schema), but is there a setting or other way to keep the 'incorrect' content-type? Otherwise, maybe amend the documentation to note all the ways in which res.jsonp differs from res.json.
Thanks for considering it.
Contributor guide
Assessment
This issue has not been assessed yet.