Skip to content

Conversation

@buroa
Copy link
Contributor

@buroa buroa commented Nov 19, 2025

Continuation of #7406

This removes the accept-encoding header from each route if a compressor is present.

@buroa buroa requested a review from a team as a code owner November 19, 2025 15:02
@buroa buroa changed the title feat: automatically set first compressor with choose_first feat: compressor remove accept encoding header Nov 19, 2025
@buroa buroa force-pushed the buroa/compressor-remove-accept-encoding-header branch from 06ba285 to 4c395ee Compare November 19, 2025 15:06
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.32%. Comparing base (6a99849) to head (e136c11).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7562      +/-   ##
==========================================
- Coverage   72.33%   72.32%   -0.02%     
==========================================
  Files         232      232              
  Lines       34109    34116       +7     
==========================================
+ Hits        24674    24675       +1     
- Misses       7664     7668       +4     
- Partials     1771     1773       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@buroa buroa force-pushed the buroa/compressor-remove-accept-encoding-header branch from 4c395ee to 80e9420 Compare November 19, 2025 17:59
@buroa
Copy link
Contributor Author

buroa commented Nov 19, 2025

/retest

@buroa buroa force-pushed the buroa/compressor-remove-accept-encoding-header branch 3 times, most recently from b0f55f4 to d2ef2f5 Compare November 19, 2025 20:17
@buroa
Copy link
Contributor Author

buroa commented Nov 19, 2025

/retest

@buroa buroa requested a review from arkodg November 20, 2025 00:31
@arkodg
Copy link
Contributor

arkodg commented Nov 20, 2025

rethinking this one, shouldnt this be enabled by default ?
what do HAProxy, NGINX and others do ?

@buroa
Copy link
Contributor Author

buroa commented Nov 20, 2025

rethinking this one, shouldnt this be enabled by default ?

what do HAProxy, NGINX and others do ?

They pass it directly to the backend, this is not defaulted anywhere.

Do we want to default it? That would make it opinionated, but I think if compression is enabled at the Envoy level, we should.

zhaohuabing

This comment was marked as resolved.

@zhaohuabing zhaohuabing self-requested a review November 20, 2025 11:10
@buroa
Copy link
Contributor Author

buroa commented Nov 20, 2025

@arkodg I just made this removeAcceptEncodingHeader default.

@buroa buroa force-pushed the buroa/compressor-remove-accept-encoding-header branch 2 times, most recently from 9d3f0af to 985c440 Compare November 20, 2025 16:36
@buroa buroa force-pushed the buroa/compressor-remove-accept-encoding-header branch from 985c440 to 28e0a06 Compare November 20, 2025 16:36
@buroa buroa changed the title feat: compressor remove accept encoding header feat: default remove accept encoding header Nov 20, 2025
Signed-off-by: Steven Kreitzer <[email protected]>
}

// Remove accept-encoding header to prevent double compression
route.RequestHeadersToRemove = append(route.RequestHeadersToRemove, "accept-encoding")
Copy link
Contributor

Choose a reason for hiding this comment

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

why aren't we using the setting from the filter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't work correctly, at all. If I append apply the removeAcceptEncodingHeader on every compressor (no matter if its on the HCM one or the route overrides), it stops compression all together. If I apply it on one, it works, but it will only remove that header if that compression is picked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I filed this in the meantime: envoyproxy/envoy#42160

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks, lets wait for the outcome of this before pushing code that needs to be updated again

Signed-off-by: Steven Kreitzer <[email protected]>
@buroa buroa force-pushed the buroa/compressor-remove-accept-encoding-header branch from d4c0e87 to d093020 Compare November 20, 2025 19:29
@buroa buroa requested a review from arkodg November 20, 2025 19:30
@arkodg arkodg added this to the v1.7.0-rc.1 Release milestone Nov 20, 2025
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.

3 participants