Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
22
node_modules/express-http-proxy/app/steps/decorateUserResHeaders.js
generated
vendored
Normal file
22
node_modules/express-http-proxy/app/steps/decorateUserResHeaders.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
function decorateUserResHeaders(container) {
|
||||
var resolverFn = container.options.userResHeaderDecorator;
|
||||
var headers = container.user.res._headers;
|
||||
|
||||
if (!resolverFn) {
|
||||
return Promise.resolve(container);
|
||||
}
|
||||
|
||||
return Promise
|
||||
.resolve(resolverFn(headers, container.user.req, container.user.res, container.proxy.req, container.proxy.res))
|
||||
.then(function(headers) {
|
||||
return new Promise(function(resolve) {
|
||||
container.user.res.set(headers);
|
||||
resolve(container);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = decorateUserResHeaders;
|
||||
Reference in New Issue
Block a user