Skip to content

GzipFilter: Weaken ETag when gzipping - #13818

Open
tsawada wants to merge 2 commits into
playframework:mainfrom
tsawada:tsawada/gzipfilter-etag
Open

tsawada wants to merge 2 commits into
playframework:mainfrom
tsawada:tsawada/gzipfilter-etag

Conversation

@tsawada

@tsawada tsawada commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Purpose

This PR updates GzipFilter to weaken strong ETags when compressing a Result.

If the Result contains an unquoted ETag, which is malformed according to RFC 9110, Section 8.8.3, GzipFilter removes the ETag header entirely.
I think this behavior is the safest fallback to prevent any downstream caching issue with invalid headers. It seems Cloudflare handles malformed ETags this way, according to their documentation.

https://developers.cloudflare.com/cache/reference/etag-headers/#important-remarks

You must set the value in a strong ETag header using double quotes (for example, etag: "foobar"). If you use an incorrect format, Cloudflare will remove the ETag header instead of converting it to a weak ETag.

I believe this improves adherence to the HTTP standards.

@tsawada
tsawada force-pushed the tsawada/gzipfilter-etag branch from 4bb9d3f to 497be8f Compare March 21, 2026 05:59
@mkurz

mkurz commented Apr 29, 2026

Copy link
Copy Markdown
Member

@Mergifyio rebase

@mkurz
mkurz force-pushed the tsawada/gzipfilter-etag branch from 20b9108 to 7fe7d9e Compare April 29, 2026 08:06
@mergify

mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Deprecation notice: This pull request comes from a fork and was rebased using bot_account impersonation. This capability will be removed on July 1, 2026. After this date, the rebase action will no longer be able to rebase fork pull requests with this configuration. Please switch to the update action/command to ensure compatibility going forward.

@mergify

mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

rebase

✅ Branch has been successfully rebased

@mkurz
mkurz force-pushed the tsawada/gzipfilter-etag branch from 7fe7d9e to 669d5ea Compare June 19, 2026 11:49
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