Skip to content
Myr

docs

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 70d6841 · Browse files · 1 file+3 added−0 removed
This commit

State

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

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:lib/response.js+3 added
180 unmodified lines
181 obj = arguments[1];182 }183 }184185 // settings186 var app = this.app187 , jsonp = app.get('jsonp callback')188 , replacer = app.get('json replacer')189 , spaces = app.get('json spaces')190 , body = JSON.stringify(obj, replacer, spaces)191 , callback = this.req.query.callback;192193 // content-type194 this.charset = this.charset || 'utf-8';195 this.set('Content-Type', 'application/json');196197 // jsonp198 if (callback && jsonp) {199 this.set('Content-Type', 'text/javascript');200 body = callback.replace(/[^[]\w$.]/g, '') + '(' + body + ');';201 }
488 unmodified lines