Skip to content
Myr

Added: allow [] in jsonp callback. Closes #1128

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 4de95c0 · Browse files · 2 files+17 added−2 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+17 added−2 removed

  • tests:+16 added−1 removed
  • other:+1 added−1 removed

2 files+17 added−2 removed

modified:lib/response.js+1 added-1 removed
157 unmodified lines
158 this.set('Content-Type', 'application/json');159160 if (callback && jsonp) {161 this.set('Content-Type', 'text/javascript');162 body = callback.replace(/[^\w$.]/g, '') + '(' + body + ');';162 body = callback.replace(/[^[]\w$.]/g, '') + '(' + body + ');';163 }164165 return this.send(body);166};
480 unmodified lines
modified:test/res.json.js+16 added-1 removed