mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
express-http-proxy: Add limit parameter for proxy options (#35014)
* Add limit parameter for proxy options * Remove null from type for limit
This commit is contained in:
committed by
Wesley Wigham
parent
b1d706c8f5
commit
880a95c647
@@ -11,6 +11,14 @@ proxy('www.google.com', {
|
||||
proxyReqPathResolver: (req) => req.url,
|
||||
});
|
||||
|
||||
proxy('www.google.com', {
|
||||
limit: "10mb"
|
||||
});
|
||||
|
||||
proxy('www.google.com', {
|
||||
limit: 1024
|
||||
});
|
||||
|
||||
proxy('www.google.com', {
|
||||
proxyReqOptDecorator(proxyReqOpts, srcReq) {
|
||||
console.log(proxyReqOpts.headers, proxyReqOpts.method);
|
||||
|
||||
Vendored
+6
@@ -11,6 +11,12 @@ import { RequestOptions, IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
|
||||
import { Response } from "express-serve-static-core";
|
||||
|
||||
interface ProxyOptions {
|
||||
/**
|
||||
* The byte limit of the body. This is the number of bytes or any string
|
||||
* format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`.
|
||||
* See https://github.com/stream-utils/raw-body/blob/master/index.d.ts
|
||||
*/
|
||||
limit?: number | string;
|
||||
proxyReqPathResolver?: (req: Request) => string;
|
||||
proxyReqOptDecorator?: (proxyReqOpts: RequestOptions, srcReq: Request) => RequestOptions;
|
||||
userResHeaderDecorator?: (headers: IncomingHttpHeaders, userReq: Request, userRes: Response, proxyReq: Request, proxyRes: Response) => OutgoingHttpHeaders;
|
||||
|
||||
Reference in New Issue
Block a user