Skip to content
Myr

remove charset from json responses. Closes #1631

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 28562b2 · Browse files · 3 files+8 added−9 removed
This commit

State

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

Diff stats

3 files+8 added−9 removed

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

3 files+8 added−9 removed

modified:lib/response.js-1 removed
183 unmodified lines
184 var spaces = app.get('json spaces');185 var body = JSON.stringify(obj, replacer, spaces);186187 // content-type188 this.charset = this.charset || 'utf-8';188 this.get('Content-Type') || this.set('Content-Type', 'application/json');189190 return this.send(body);191};
566 unmodified lines
modified:test/res.json.js+7 added-7 removed
modified:test/res.send.js+1 added-1 removed
200 unmodified lines
201202 request(app)203 .get('/')204 .end(function(err, res){205 res.headers.should.have.property('content-type', 'application/json; charset=utf-8');205 res.headers.should.have.property('content-type', 'application/json');206 res.text.should.equal('{"name":"tobi"}');207 done();208 })209 })
112 unmodified lines