express-jsonp2
Advanced tools
Comparing version 0.0.1 to 0.0.2
10
index.js
@@ -53,9 +53,9 @@ | ||
// call parent | ||
if (this.req.method !== 'GET') { | ||
callback = 'parent.' + callback; | ||
} | ||
if (callback && 'string' === typeof callback) { | ||
var cb = callback.replace(/[^\[\]\w$.]/g, ''); | ||
if (this.req.method !== 'GET') { | ||
cb = 'parent.' + cb; | ||
} | ||
body = 'typeof ' + cb + ' === \'function\' && ' + cb + '(' + body + ');'; | ||
@@ -62,0 +62,0 @@ |
{ | ||
"name": "express-jsonp2", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "express-jsonp2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -57,2 +57,14 @@ | ||
it('should return json in absence of callback', function (done) { | ||
request(bootstrap()) | ||
.post('/') | ||
.expect(200) | ||
.end(function (err, res) { | ||
res.text.should.equal('{"name":"thom"}'); | ||
done(); | ||
}); | ||
}); | ||
it('should wrap in callback if provided', function (done) { | ||
@@ -59,0 +71,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6734
131