Remove unnecessary escaping in res.jsonp

This commit is contained in:
Douglas Christopher Wilson
2014-07-11 00:20:11 -04:00
parent f684a64df7
commit b2382a7336
3 changed files with 25 additions and 5 deletions

View File

@@ -98,6 +98,19 @@ describe('res', function(){
.expect(200, /foo\(\{"str":"\\u2028 \\u2029 woot"\}\);/, done);
});
it('should not escape utf whitespace for json fallback', function(done){
var app = express();
app.use(function(req, res){
res.jsonp({ str: '\u2028 \u2029 woot' });
});
request(app)
.get('/')
.expect('Content-Type', 'application/json; charset=utf-8')
.expect(200, '{"str":"\u2028 \u2029 woot"}', done);
});
it('should include security header and prologue', function (done) {
var app = express();