Skip to content
Myr

add support for `res.json()` to retain previously defined Content-Types. Closes #1349

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 1029b0b · Browse files · 2 files+19 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+19 added−1 removed

  • tests:+18 added−0 removed
  • other:+1 added−1 removed

2 files+19 added−1 removed

modified:lib/response.js+1 added-1 removed
188 unmodified lines
189 var body = JSON.stringify(obj, replacer, spaces);190191 // content-type192 this.charset = this.charset || 'utf-8';193 this.set('Content-Type', 'application/json');193 if (!this.get('Content-Type')) this.set('Content-Type', 'application/json');194 195 return this.send(body);196};197
522 unmodified lines
modified:test/res.json.js+18 added