express-http-proxy icon indicating copy to clipboard operation
express-http-proxy copied to clipboard

accessing proxy headers in userResHeaderDecorator

Open mg opened this issue 7 years ago • 1 comments

Hi,

userResHeaderDecorator is confusing me. Im trying to access a header value that was set in proxyReqOptDecorator before sending the request but I do not understand how to access it.

In userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes), proxyReq is ALWAYS an empty object ( console.log outputs {}) but if I console log proxyRes I can see the value I want, but it is burried in proxyRes.req._header.

How should I access my header value, what would be the correct way?

cheers, mg

mg avatar Oct 02 '18 14:10 mg

Hi @mg,

It makes sense this is confusing; the documentation is very sparse! I will update the docs and clarify the issue you've raised about proxyReq being empty.

Thanks for raising this issue.

monkpow avatar Oct 19 '18 18:10 monkpow