villadora / express-http-proxy

Proxy middleware for express/connect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

path can't be set in proxyReqOptDecorator as documented

BasHamer opened this issue · comments

if the proxyReqPathResolver method is not provided but you set the path in proxyReqOptDecorator then the path gets overwritten with the original path by the default for proxyReqPathResolver.

code:
proxyReqOptDecorator : function(proxyReq, originalReq) {
proxyReq.path = 'bob';
return proxyReq;
},

by itself will have no effect, you need to add
proxyReqPathResolver: function(req) {
return 'bob';
},

to make that work.

The documentation is misleading on this subject :/

oof, thanks for that. I'll update the docs.

Thanks for this. This is as designed, but the docs were absolutely wrong. I'm sure that was frustrating to debug.