Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sirdarckcat committed Jan 22, 2021
1 parent f680405 commit fbbbe71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 2020/quals/web-littlethings-fixed/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,14 @@ const is_debug = (req, res, next) => {
/* jsonp endpoint */
const jsonp = (req, res, next) => {
res.jsonp = function (obj = {}) {
const blacklist = /[^\w\.=]/ugi;
const pattern = /[^\w\.=]/ugi;
let cb = req.query.cb || 'console.log';
this.set('Content-type', 'text/javascript; charset=utf-8');

if (Array.isArray(cb)) {
cb = cb[0]
}
cb = cb.replace(blacklist, '');
cb = cb.replace(pattern, '');
body = `${cb}(${JSON.stringify(obj)})`
return this.send(body)
}
Expand Down

0 comments on commit fbbbe71

Please sign in to comment.