diff --git a/docs/content/reference/routing-configuration/http/middlewares/retry.md b/docs/content/reference/routing-configuration/http/middlewares/retry.md index 7997efb48..28b52e572 100644 --- a/docs/content/reference/routing-configuration/http/middlewares/retry.md +++ b/docs/content/reference/routing-configuration/http/middlewares/retry.md @@ -96,7 +96,7 @@ spec: | `attempts` | number of times the request should be retried. | | Yes | | `initialInterval` | First wait time in the exponential backoff series.
The maximum interval is calculated as twice the `initialInterval`.
If unspecified, requests will be retried immediately.
Defined in seconds or as a valid duration format, see [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration). | 0 | No | | `timeout` | How much time the middleware is allowed to retry the request.
Defined in seconds or as a valid duration format, see [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration). | 0 | No | -| `maxRequestBodyBytes` | Defines the maximum size for the request body. Default is `-1`, which means no limit.
More information [here](#maxrequestbodybytes). | -1 | No | +| `maxRequestBodyBytes` | Defines the maximum size for the request body.
More information [here](#maxrequestbodybytes). | 2MB | No | | `status` | Defines the range of HTTP status codes to retry on.
More information [here](#disableretryonnetworkerror-and-status). | [] | No | | `disableRetryOnNetworkError` | This option disables the retry if an error occurs when transmitting the request to the server.
More information [here](#disableretryonnetworkerror-and-status). | false | No | | `retryNonIdempotentMethod` | Activates the retry for non-idempotent methods (`POST`, `LOCK`, `PATCH`) | false | No | @@ -107,7 +107,7 @@ The `maxRequestBodyBytes` option controls the maximum size of request bodies tha **⚠️ Important Security Consideration** -By default, `maxRequestBodyBytes` is not set (value: -1), which means request body size is unlimited. This can have significant security and performance implications: +When `maxRequestBodyBytes` is set to `-1`, it means there is no limit for request body size. This can have significant security and performance implications: - **Security Risk**: Attackers can send extremely large request bodies, potentially causing DoS attacks or memory exhaustion - **Performance Impact**: Large request bodies consume memory and processing resources, affecting overall system performance diff --git a/pkg/config/dynamic/middlewares.go b/pkg/config/dynamic/middlewares.go index 1b56ba5ab..7a3d2b8b7 100644 --- a/pkg/config/dynamic/middlewares.go +++ b/pkg/config/dynamic/middlewares.go @@ -14,7 +14,7 @@ const ( // ForwardAuthDefaultMaxBodySize is the ForwardAuth.MaxBodySize option default value. ForwardAuthDefaultMaxBodySize int64 = -1 // RetryDefaultMaxRequestBodyBytes is the Retry.MaxRequestBodyBytes option default value. - RetryDefaultMaxRequestBodyBytes int64 = -1 + RetryDefaultMaxRequestBodyBytes int64 = 2 * 1024 * 1024 // 2 MB ) // +k8s:deepcopy-gen=true