mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[@types/express-http-proxy] Add proxyReqBodyDecorator property to ProxyOptions (#36485)
* feat: add proxyReqBodyDecorator to ProxyOptions * style: group all callback functions
This commit is contained in:
parent
9c3af8d04e
commit
43b735cdf0
@ -128,3 +128,17 @@ proxy("httpbin.org", {
|
||||
proxy("httpbin.org", {
|
||||
timeout: 2000
|
||||
});
|
||||
|
||||
proxy("www.google.com", {
|
||||
proxyReqBodyDecorator(bodyContent, srcReq) {
|
||||
return bodyContent;
|
||||
}
|
||||
});
|
||||
|
||||
proxy("www.google.com", {
|
||||
proxyReqBodyDecorator(bodyContent, srcReq) {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(bodyContent);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
5
types/express-http-proxy/index.d.ts
vendored
5
types/express-http-proxy/index.d.ts
vendored
@ -43,11 +43,12 @@ declare namespace proxy {
|
||||
userReq: Request,
|
||||
userRes: Response
|
||||
) => Buffer | string | Promise<Buffer | string>;
|
||||
filter?: (req: Request, res: Response) => boolean;
|
||||
skipToNextHandlerFilter?: (proxyRes: Response) => boolean;
|
||||
proxyReqBodyDecorator?: (bodyContent: any, srcReq: Request) => any;
|
||||
preserveHostHdr?: boolean;
|
||||
parseReqBody?: boolean;
|
||||
filter?: (req: Request, res: Response) => boolean;
|
||||
memoizeHost?: boolean;
|
||||
skipToNextHandlerFilter?: (proxyRes: Response) => boolean;
|
||||
https?: boolean;
|
||||
reqAsBuffer?: boolean;
|
||||
reqBodyEncoding?: string | null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user