gateway icon indicating copy to clipboard operation
gateway copied to clipboard

feat: default remove accept encoding header

Open buroa opened this issue 1 month ago • 10 comments

Continuation of https://github.com/envoyproxy/gateway/pull/7406

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

buroa avatar Nov 19 '25 15:11 buroa

Codecov Report

:x: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 72.39%. Comparing base (c1c227b) to head (0208d19).

Files with missing lines Patch % Lines
internal/xds/translator/compressor.go 71.42% 0 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7562      +/-   ##
==========================================
+ Coverage   72.38%   72.39%   +0.01%     
==========================================
  Files         234      234              
  Lines       34562    34565       +3     
==========================================
+ Hits        25016    25022       +6     
+ Misses       7756     7754       -2     
+ Partials     1790     1789       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Nov 19 '25 15:11 codecov[bot]

/retest

buroa avatar Nov 19 '25 18:11 buroa

/retest

buroa avatar Nov 19 '25 23:11 buroa

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

arkodg avatar Nov 20 '25 00:11 arkodg

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.

buroa avatar Nov 20 '25 01:11 buroa

@arkodg I just made this removeAcceptEncodingHeader default.

buroa avatar Nov 20 '25 15:11 buroa

/retest

buroa avatar Nov 25 '25 10:11 buroa

@arkodg Can you please review?

buroa avatar Dec 11 '25 14:12 buroa

since this's a behavior change, please add it in the release-notes.

zirain avatar Dec 12 '25 01:12 zirain

since this's a behavior change, please add it in the release-notes.

@zirain Done :)

buroa avatar Dec 12 '25 15:12 buroa

have 2 open questions

  • why does this PR impact chooseFirst ? which seems unrelated to removing the header
  • should this be enabled by default or opt in ? looking for a more data / strong case to pick one over other

arkodg avatar Dec 13 '25 02:12 arkodg

have 2 open questions

  • why does this PR impact chooseFirst ? which seems unrelated to removing the header
  • should this be enabled by default or opt in ? looking for a more data / strong case to pick one over other

@arkodg It was having issues when getting to the unit tests where chooseFirst was not picking the correct compression (due to ordering maybe?). So I put it where it made sense: where it was building the compressors instead of the rendering.

And for the second one, Fastly for example does remove it for requests. We can make it an option if we would like? Let me know and I can update the PR.

buroa avatar Dec 13 '25 13:12 buroa

/retest

buroa avatar Dec 13 '25 16:12 buroa

Unfortunately, there was a release-notes/current.yaml conflict due to https://github.com/envoyproxy/gateway/commit/92d2a1a5a99deb3842b1cf888b2639d2a8c6cd7d#diff-8261eaec1f1079fe46bee37a988c04a7876b25a7c93fdc67db2f918ee5e406fb. Rebased and updated.

buroa avatar Dec 15 '25 15:12 buroa

/retest

buroa avatar Dec 15 '25 17:12 buroa