Skip to content
Myr

removed jsonp stripping

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

I cannot recall why I added this, doesnt make sense to me now haha.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 2aaf0de · Browse files · 2 files+1 added−19 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+1 added−19 removed

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

2 files+1 added−19 removed

modified:lib/response.js+1 added-1 removed
133 unmodified lines
134 this.header('Content-Type', 'application/json');135136 if (callback && jsonp) {137 this.header('Content-Type', 'text/javascript');138 body = callback.replace(/[^\w$.]/g, '') + '(' + body + ');';138 body = callback + '(' + body + ');';139 }140141 return this.send(body, headers, status);142};
320 unmodified lines
modified:test/response.test.js-18 removed
211 unmodified lines
212 , status: 201, headers: {213 'Content-Type': 'text/javascript; charset=utf-8'214 , 'X-Foo': 'baz'215 }});216 217 assert.response(app,218 { url: '/jsonp?callback=invalid()[]' },219 { body: 'invalid({"foo":"bar"});'220 , status: 201221 , headers: {222 'Content-Type': 'text/javascript; charset=utf-8'223 , 'X-Foo': 'baz'224 }});216 },217218 'test #json() JSONP': function(){219 var app = express.createServer();
20 unmodified lines
240 , status: 201, headers: {241 'Content-Type': 'text/javascript; charset=utf-8'242 , 'X-Foo': 'baz'243 }});253 254 assert.response(app,255 { url: '/jsonp?callback=invalid()[]' },256 { body: 'invalid({"foo":"bar"});'257 , status: 201258 , headers: {259 'Content-Type': 'text/javascript; charset=utf-8'260 , 'X-Foo': 'baz'261 }});244 },245246 'test #contentType()': function(){247 var app = express.createServer();
508 unmodified lines