Skip to content
Myr

change jsonp callback default to false. Closes #1304

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 87468cf · Browse files · 2 files+6 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+6 added−2 removed

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

2 files+6 added−2 removed

modified:lib/application.js-1 removed
80 unmodified lines
81 // default locals82 this.locals.settings = this.settings;8384 // default configuration85 this.enable('jsonp callback');85 this.set('jsonp callback name', 'callback');8687 this.configure('development', function(){88 this.set('json spaces', 2);
445 unmodified lines
modified:test/res.json.js+6 added-1 removed
7 unmodified lines
8 describe('when "jsonp callback" is enabled', function(){9 it('should respond with jsonp', function(done){10 var app = express();1112 app.enable('jsonp callback');1314 app.use(function(req, res){15 res.json({ count: 1 });16 });17
7 unmodified lines
25 })2627 it('should allow renaming callback', function(done){28 var app = express();27 2930 app.enable('jsonp callback');31 app.set('jsonp callback name', 'clb');3233 app.use(function(req, res){34 res.json({ count: 1 });35 });36
8 unmodified lines
45 46 it('should allow []', function(done){47 var app = express();4849 app.enable('jsonp callback');50 app.use(function(req, res){51 res.json({ count: 1 });52 });53
157 unmodified lines