Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

res.json overrides res.type #1349

benw opened this Issue Sep 26, 2012 · 3 comments


None yet
2 participants

benw commented Sep 26, 2012

res.json({'hello': 'world'});

Content-Type: application/json; charset=utf-8

I would like res.json (and res.send) to leave Content-Type alone if it has already been set. Thanks. :)


tj commented Sep 26, 2012

+1 I'll patch tomorrow

@tj tj closed this in 0d3a637 Sep 26, 2012


tj commented Sep 26, 2012

res.send() already has this. thanks for the report!

benw commented Sep 27, 2012

Thanks! Looks like res.send calls res.json when body is an object, so I think you've fixed them both now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment