Skip to content

fix(brotli): Preserve ETag and Last-Modified headers in Brotli-compressed response#12853

Merged
Baoyuantop merged 5 commits intoapache:masterfrom
yuweizzz:etag
Apr 13, 2026
Merged

fix(brotli): Preserve ETag and Last-Modified headers in Brotli-compressed response#12853
Baoyuantop merged 5 commits intoapache:masterfrom
yuweizzz:etag

Conversation

@yuweizzz
Copy link
Copy Markdown
Contributor

Description

Downgrade etag when in needed.

Which issue(s) this PR fixes:

Fixes #12707

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working plugin labels Dec 31, 2025
Comment thread apisix/plugins/brotli.lua Outdated
Comment thread apisix/plugins/brotli.lua
@Baoyuantop Baoyuantop added the wait for update wait for the author's response in this issue/PR label Jan 4, 2026
@Baoyuantop Baoyuantop added awaiting review and removed wait for update wait for the author's response in this issue/PR labels Jan 5, 2026
@yuweizzz yuweizzz requested a review from Baoyuantop January 5, 2026 10:24
@Baoyuantop Baoyuantop added wait for update wait for the author's response in this issue/PR and removed awaiting review labels Jan 7, 2026
@yuweizzz
Copy link
Copy Markdown
Contributor Author

@Baoyuantop

@yuweizzz
Copy link
Copy Markdown
Contributor Author

any update?

@Baoyuantop Baoyuantop added awaiting review and removed wait for update wait for the author's response in this issue/PR user responded labels Jan 22, 2026
Copy link
Copy Markdown
Member

@moonming moonming left a comment

Choose a reason for hiding this comment

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

Hi @yuweizzz, thanks for fixing the Brotli ETag preservation issue (#12707)!

Downgrading strong ETags to weak ETags after compression is the correct behavior per HTTP spec (RFC 7232). With 6 reviews, this looks well-discussed.

To confirm merge readiness:

  1. Are all review comments addressed?
  2. Does the fix also handle the Last-Modified header correctly alongside ETag?
  3. Tests look present — do they cover both strong and weak ETag inputs?

This seems close to ready. Thank you!

@yuweizzz
Copy link
Copy Markdown
Contributor Author

yes, I confirm that all the part your mentioned has fixed now.

@yuweizzz
Copy link
Copy Markdown
Contributor Author

any update?

@Baoyuantop Baoyuantop merged commit b383ade into apache:master Apr 13, 2026
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review bug Something isn't working plugin size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: ETag and Last-Modified headers are not preserved when response is Brotli-compressed

5 participants