mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
27 lines
547 B
JavaScript
27 lines
547 B
JavaScript
var passes = exports;
|
|
|
|
/*!
|
|
* Array of passes.
|
|
*
|
|
* A `pass` is just a function that is executed on `req, res, options`
|
|
* so that you can easily add new checks while still keeping the base
|
|
* flexible.
|
|
*/
|
|
|
|
[ // <--
|
|
|
|
function writeStatusCode(res, proxyRes) {
|
|
res.writeHead(proxyRes.statusCode);
|
|
},
|
|
|
|
function writeHeaders(res, proxyRes) {
|
|
Object.keys(proxyRes.headers).forEach(function(key) {
|
|
res.setHeader(key, proxyRes.headers[key]);
|
|
});
|
|
}
|
|
|
|
] // <--
|
|
.forEach(function(func) {
|
|
passes[func.name] = func;
|
|
});
|