Changed some settings in cors-anywhere

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-20 16:39:07 +02:00
parent da56e503f0
commit dff5f9dc7a
274 changed files with 26 additions and 39297 deletions

View File

@@ -1,26 +0,0 @@
/**
* Initialization middleware, exposing the
* request and response to each other, as well
* as defaulting the X-Powered-By header field.
*
* @param {Function} app
* @return {Function}
* @api private
*/
exports.init = function(app){
return function expressInit(req, res, next){
if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
req.res = res;
res.req = req;
req.next = next;
req.__proto__ = app.request;
res.__proto__ = app.response;
res.locals = res.locals || Object.create(null);
next();
};
};

View File

@@ -1,30 +0,0 @@
/**
* Module dependencies.
*/
var parseUrl = require('parseurl');
var qs = require('qs');
/**
* @param {Object} options
* @return {Function}
* @api public
*/
module.exports = function query(options) {
var queryparse = qs.parse;
if (typeof options === 'function') {
queryparse = options;
options = undefined;
}
return function query(req, res, next){
if (!req.query) {
var val = parseUrl(req).query;
req.query = queryparse(val, options);
}
next();
};
};