Allow configuring decoder buffer limit per Route via filter
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 428
Description
*Description*:
>Describe the desired behavior, what scenario it enables and how it
would be used.
Setting the per Route decoder buffer limit would be useful for increasing the limit in some routes that need to deal with big request body in a fully buffering filter. Currently, to configure a per Route level decoder buffer limit, we can use the `buffer` filter. However, there is a side effect that the `buffer` filter will buffer all the request body. In some cases, the fully buffering is optional, for example, a WAF filter may skip the request body according to the configuration. Buffering the whole request body early will cause an unexpected 413 response.
What we actually need is just calling the `setDecoderBufferLimit` like
https://github.com/envoyproxy/envoy/blob/62e7c593748b2ceb3b80a3398e0a937a92edf95d/source/extensions/filters/http/buffer/buffer_filter.cc#L63
Can we add a new option `set_limit_only` in the `buffer` filter to call the `setDecoderBufferLimit` without doing the buffering? Or maybe we need to add a new filter for this purpose? I will submit a PR if this feature is accepted.
Contributor guide
Assessment
This issue has not been assessed yet.