express-http-proxy: proxyReqPathResolver can also return Promise<string> (#43528)

* Add test, too

* proxyReqPathResolver: can also return promise

proxyReqPathResolver can also return a promise to a string

* Update version number

Update version number of express-http-proxy to 1.6
This commit is contained in:
Erwin Wessels
2020-04-01 09:44:40 -07:00
committed by GitHub
parent 055c8fcfbf
commit 17673008d4
2 changed files with 6 additions and 2 deletions
@@ -11,6 +11,10 @@ proxy("www.google.com", {
proxyReqPathResolver: req => req.url
});
proxy("www.google.com", {
proxyReqPathResolver: async req => req.url
});
proxy("www.google.com", {
limit: "10mb"
});
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for express-http-proxy 1.5
// Type definitions for express-http-proxy 1.6
// Project: https://github.com/villadora/express-http-proxy#readme
// Definitions by: ulrichb <https://github.com/ulrichb>
// Daniel Schopf <https://github.com/Danscho>
@@ -25,7 +25,7 @@ declare namespace proxy {
res: Response,
next: NextFunction
) => any;
proxyReqPathResolver?: (req: Request) => string;
proxyReqPathResolver?: (req: Request) => string | Promise<string>;
proxyReqOptDecorator?: (
proxyReqOpts: RequestOptions,
srcReq: Request