Skip to content
Myr

remove res.charset usage

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

authored by Jonathan Ong · committed by Jonathan Ong · parent 3228fd3 · Browse files · 2 files+5 added−13 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+5 added−13 removed

  • tests:+3 added−3 removed
  • other:+2 added−10 removed

2 files+5 added−13 removed

modified:lib/response.js+2 added-10 removed
104 unmodified lines
105 body = http.STATUS_CODES[body];106 break;107 // string defaulting to html108 case 'string':109 if (!this.get('Content-Type')) {110 this.charset = this.charset || 'utf-8';111 this.type('html');112 }109 if (!this.get('Content-Type')) this.type('html');110 break;111 case 'boolean':112 case 'object':113 if (null == body) {
71 unmodified lines
185 var spaces = app.get('json spaces');186 var body = JSON.stringify(obj, replacer, spaces);187188 // content-type192 this.charset = this.charset || 'utf-8';189 this.get('Content-Type') || this.set('Content-Type', 'application/json');190191 return this.send(body);192};
35 unmodified lines
228 .replace(/\u2029/g, '\\u2029');229 var callback = this.req.query[app.get('jsonp callback name')];230231 // content-type236 this.charset = this.charset || 'utf-8';232 this.set('Content-Type', 'application/json');233234 // jsonp235 if (callback) {
225 unmodified lines
461462 this.vary("Accept");463464 if (key) {470 var type = normalizeType(key).value;471 var charset = mime.charsets.lookup(type);472 if (charset) type += '; charset=' + charset;473 this.set('Content-Type', type);465 this.set('Content-Type', normalizeType(key).value);466 obj[key](req, this, next);467 } else if (fn) {468 fn();469 } else {
308 unmodified lines
modified:test/res.format.js+3 added-3 removed