Clarify buffering middleware defaults#13401
Conversation
|
Hey @amazon7737, |
kevinpollet
left a comment
There was a problem hiding this comment.
Hello @amazon7737,
I reviewed your pull request and added some comments.
As this pull request is a fix, could you rebase it on branch v3.6?
However, I tried to figure out whether something was wrong with the buffering middleware causing the issue, but on my side the defaults look good.
Did you tried to reproduce the issue?
7a875f8 to
def2e74
Compare
Hello @kevinpollet, No, I did not reproduce it in the reporter's exact environment. What I checked locally was narrower. With a temporary focused Go test against v3.1.2, I verified that adding the buffering middleware with Without buffering, the upstream received the large request as chunked. With buffering enabled, the upstream received it with a fixed So the intent of this PR was to document that buffering side effect. I will update the wording based on your comments. |
…buffering.md Co-authored-by: Kevin Pollet <[email protected]>
221562b to
5eb593d
Compare
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [traefik](https://github.com/containous/traefik) | patch | `v3.7.6` → `v3.7.7` | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/12) for more information. --- ### Release Notes <details> <summary>containous/traefik (traefik)</summary> ### [`v3.7.7`](https://github.com/traefik/traefik/releases/tag/v3.7.7) [Compare Source](traefik/traefik@v3.7.7...v3.7.7) **Important:** Please read the [migration guide](https://doc.traefik.io/traefik/v3.7/migrate/v3/#v377). **Bug fixes:** - **\[middleware, k8s/ingress-nginx]** Add app-root middleware with nginx variable interpolation ([#​13398](traefik/traefik#13398) [@​dfeinblatt](https://github.com/dfeinblatt)) - **\[rules]** Fix consistency between HostSNI(*) and Host(*) ([#​13460](traefik/traefik#13460) [@​juliens](https://github.com/juliens)) - **\[k8s, k8s/gatewayapi]** Fix ExtensionRef filters on backendRefs to resolve against the HTTPRoute namespace ([#​13462](traefik/traefik#13462) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Fix handle empty unknown-length bodies in mirroring ([#​13399](traefik/traefik#13399) [@​amazon7737](https://github.com/amazon7737)) - **\[k8s/crd]** Fix cross-provider ref check for TCP ServersTransport in Kubernetes CRD provider ([#​13458](traefik/traefik#13458) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Sanitize replaced path in ReplacePathRegex middleware ([#​13466](traefik/traefik#13466) [@​kevinpollet](https://github.com/kevinpollet)) - **\[acme]** Bump software.sslmate.com/src/go-pkcs12 to v0.7.3 ([#​13477](traefik/traefik#13477) [@​rtribotte](https://github.com/rtribotte)) - **\[otel]** Bump go.opentelemetry.io/otel to v1.44.0 ([#​13478](traefik/traefik#13478) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s]** Fix panic when endpointslice port value or name is nil ([#​13481](traefik/traefik#13481) [@​kevinpollet](https://github.com/kevinpollet)) **Documentation:** - Fix version in migration guide ([#​13434](traefik/traefik#13434) [@​kevinpollet](https://github.com/kevinpollet)) - Fix changelog v2.11.51 ([#​13430](traefik/traefik#13430) [@​mmatur](https://github.com/mmatur)) - Add v3.7 to supported version docs ([#​13118](traefik/traefik#13118) [@​jnoordsij](https://github.com/jnoordsij)) - Fix some function names in comments ([#​13443](traefik/traefik#13443) [@​blackflytech](https://github.com/blackflytech)) - Add [@​nandorKollar](https://github.com/nandorKollar) as a current maintainer ([#​13451](traefik/traefik#13451) [@​emilevauge](https://github.com/emilevauge)) - Add [@​amazon7737](https://github.com/amazon7737) as a current maintainer ([#​13450](traefik/traefik#13450) [@​emilevauge](https://github.com/emilevauge)) - **\[middleware]** Clarify buffering middleware defaults ([#​13401](traefik/traefik#13401) [@​amazon7737](https://github.com/amazon7737)) - Fix grammar in TLS, TCP service, and routing reference docs ([#​13461](traefik/traefik#13461) [@​almightymoon](https://github.com/almightymoon)) - Fix X-Forwarded-Prefix documentation for dashboard redirection ([#​13472](traefik/traefik#13472) [@​kevinpollet](https://github.com/kevinpollet)) ### [`v3.7.7`](https://github.com/traefik/traefik/releases/tag/v3.7.7) [Compare Source](traefik/traefik@v3.7.6...v3.7.7) **Important:** Please read the [migration guide](https://doc.traefik.io/traefik/v3.7/migrate/v3/#v377). **Bug fixes:** - **\[middleware, k8s/ingress-nginx]** Add app-root middleware with nginx variable interpolation ([#​13398](traefik/traefik#13398) [@​dfeinblatt](https://github.com/dfeinblatt)) - **\[rules]** Fix consistency between HostSNI(*) and Host(*) ([#​13460](traefik/traefik#13460) [@​juliens](https://github.com/juliens)) - **\[k8s, k8s/gatewayapi]** Fix ExtensionRef filters on backendRefs to resolve against the HTTPRoute namespace ([#​13462](traefik/traefik#13462) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Fix handle empty unknown-length bodies in mirroring ([#​13399](traefik/traefik#13399) [@​amazon7737](https://github.com/amazon7737)) - **\[k8s/crd]** Fix cross-provider ref check for TCP ServersTransport in Kubernetes CRD provider ([#​13458](traefik/traefik#13458) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Sanitize replaced path in ReplacePathRegex middleware ([#​13466](traefik/traefik#13466) [@​kevinpollet](https://github.com/kevinpollet)) - **\[acme]** Bump software.sslmate.com/src/go-pkcs12 to v0.7.3 ([#​13477](traefik/traefik#13477) [@​rtribotte](https://github.com/rtribotte)) - **\[otel]** Bump go.opentelemetry.io/otel to v1.44.0 ([#​13478](traefik/traefik#13478) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s]** Fix panic when endpointslice port value or name is nil ([#​13481](traefik/traefik#13481) [@​kevinpollet](https://github.com/kevinpollet)) **Documentation:** - Fix version in migration guide ([#​13434](traefik/traefik#13434) [@​kevinpollet](https://github.com/kevinpollet)) - Fix changelog v2.11.51 ([#​13430](traefik/traefik#13430) [@​mmatur](https://github.com/mmatur)) - Add v3.7 to supported version docs ([#​13118](traefik/traefik#13118) [@​jnoordsij](https://github.com/jnoordsij)) - Fix some function names in comments ([#​13443](traefik/traefik#13443) [@​blackflytech](https://github.com/blackflytech)) - Add [@​nandorKollar](https://github.com/nandorKollar) as a current maintainer ([#​13451](traefik/traefik#13451) [@​emilevauge](https://github.com/emilevauge)) - Add [@​amazon7737](https://github.com/amazon7737) as a current maintainer ([#​13450](traefik/traefik#13450) [@​emilevauge](https://github.com/emilevauge)) - **\[middleware]** Clarify buffering middleware defaults ([#​13401](traefik/traefik#13401) [@​amazon7737](https://github.com/amazon7737)) - Fix grammar in TLS, TCP service, and routing reference docs ([#​13461](traefik/traefik#13461) [@​almightymoon](https://github.com/almightymoon)) - Fix X-Forwarded-Prefix documentation for dashboard redirection ([#​13472](traefik/traefik#13472) [@​kevinpollet](https://github.com/kevinpollet)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.jfreudenberger.de/JuliusFreudenberger/nix-config/pulls/18 Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
What does this PR do?
Clarifies that buffering middleware options only apply when the middleware is explicitly attached to a router.
It also explains that
maxRequestBodyBytes=0keeps the request body size unlimited, but enabling the middleware still buffers the request before forwarding it upstream.Motivation
Related to #11323.
In that issue, setting
maxRequestBodyBytes=0appeared to change large POST behavior. The important distinction is that configuring the option also enables the buffering middleware for the router, which can change how the request is forwarded upstream.More