api: drop JSONP (#4835)

* api: drop JSONP

* docs: drop JSONP

* tests: drop JSONP

* api: remove isValidJSONPName require
This commit is contained in:
John McLear 2021-02-22 09:10:02 +00:00 committed by GitHub
parent 85231cb774
commit 0f16e518ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 109 deletions

View file

@ -22,7 +22,6 @@ const createHTTPError = require('http-errors');
const apiHandler = require('../../handler/APIHandler');
const settings = require('../../utils/Settings');
const isValidJSONPName = require('./isValidJSONPName');
const log4js = require('log4js');
const logger = log4js.getLogger('API');
@ -686,12 +685,6 @@ exports.expressCreateServer = (hookName, args, cb) => {
}
}
// support jsonp response format
if (req.query.jsonp && isValidJSONPName.check(req.query.jsonp)) {
res.header('Content-Type', 'application/javascript');
response = `${req.query.jsonp}(${JSON.stringify(response)})`;
}
// send response
return res.send(response);
});