MCPcopy Index your code
hub / github.com/restify/node-restify / _jsonp

Function _jsonp

lib/plugins/jsonp.js:26–39  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

24 */
25function jsonp() {
26 function _jsonp(req, res, next) {
27 var q = req.getQuery();
28
29 // If the query plugin wasn't used, we need to hack it in now
30 if (typeof q === 'string') {
31 req.query = qs.parse(q);
32 }
33
34 if (req.query.callback || req.query.jsonp) {
35 res.setHeader('Content-Type', 'application/javascript');
36 }
37
38 next();
39 }
40
41 return _jsonp;
42}

Callers

nothing calls this directly

Calls 1

nextFunction · 0.50

Tested by

no test coverage detected