Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

res.json overrides res.type #1349

Closed
benw opened this Issue · 3 comments

2 participants

@benw
res.type('application/vnd.example+json');
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
tj commented

+1 I'll patch tomorrow

@tj tj closed this in 0d3a637
@tj
tj commented

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

@benw

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
Something went wrong with that request. Please try again.