From 65c6fc4f8c4ace78d77b55c2b26ef9da1b64926b Mon Sep 17 00:00:00 2001 From: Nick Simmons Date: Wed, 27 Jan 2021 11:22:03 -0500 Subject: [PATCH] Correct docs for proxyReqOptDecorator - cannot modify request path --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4305f21..fab1241 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,8 @@ You can mutate the request options before sending the proxyRequest. proxyReqOpt represents the options argument passed to the (http|https).request module. +NOTE: req.path cannot be changed via this method; use ```proxyReqPathResolver``` instead. + ```js app.use(proxy('www.google.com', { proxyReqOptDecorator: function(proxyReqOpts, ctx) { @@ -198,8 +200,6 @@ app.use(proxy('www.google.com', { proxyReqOpts.headers['content-type'] = 'text/html'; // you can change the method proxyReqOpts.method = 'GET'; - // you could change the path - proxyReqOpts.path = 'http://dev/null' return proxyReqOpts; } }));