Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #33 from nsimmons/update-incorrect-docs-for-proxyR…
Browse files Browse the repository at this point in the history
…eqOptDecorator

Correct docs for proxyReqOptDecorator - cannot modify request path
  • Loading branch information
Nicholas Simmons authored Jan 27, 2021
2 parents 2646d7f + 65c6fc4 commit 9c1acbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ 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) {
// you can update headers
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;
}
}));
Expand Down

0 comments on commit 9c1acbf

Please sign in to comment.