Skip to content

decompressor: support use as an upstream HTTP filter - #49084

Open
botengyao wants to merge 2 commits into
envoyproxy:mainfrom
botengyao:decompressor-upstream-filter
Open

botengyao wants to merge 2 commits into
envoyproxy:mainfrom
botengyao:decompressor-upstream-filter

Conversation

@botengyao

Copy link
Copy Markdown
Member

Commit Message: decompressor: support use as an upstream HTTP filter. The decompressor filter can now be configured in the router's or a cluster's upstream HTTP filter chain, matching the compressor filter (#46490).

Additional Description:
The filter only reads and rewrites headers, body and trailers, which the upstream filter manager already supports. So the change is the upstream factory registration plus the envoy.filters.http.upstream category, with status_upstream: alpha as for the compressor. The existing integration suite now runs every case twice: with the filter in the HCM chain, and in the cluster's upstream HTTP filter chain.

Known limitation, shared with the upstream compressor: upstream filters edit the router's request header map in place, and the router does not restore it before a retry. A retry resends a copy of the original buffered body. So after request-direction decompression on the first try, content-encoding has already been removed. The retried request then carries the still-compressed body without that header. This needs a fix in the router rather than in each filter, so it is not addressed here.

Signed-off-by: Boteng Yao <botengyao@gmail.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #49084 was opened by botengyao.

see: more, trace.

@botengyao
botengyao marked this pull request as ready for review November 8, 2026 04:03
KBaichoo
KBaichoo previously approved these changes Nov 17, 2026

@KBaichoo KBaichoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the regression test that proves this doesn't work for upstream retries?

Upstream HTTP Filter Support
----------------------------

The decompressor filter can also be configured as an upstream HTTP filter, for example in the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add for now that it's broken for retries since that'll be extremely confusing to debug?

Signed-off-by: Boteng Yao <botengyao@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants