Repository navigation
Conversation
Motivation: The existing Gzip directive tests do not exercise the exact minimum length of an application-provided response encoding filter. Modification: Use the public route-local Gzip filter on two known-length responses. Verify the response below the limit is unchanged and the one at the limit is compressed and decodes to its original bytes. Result: Protect the filter's access to the original entity length without changing production code or the default encoding policy. Tests: Focused JDK 17 native tests passed on Scala 2.13.18 and 3.3.9. References: RFC 9110 section 12.5.3 for Accept-Encoding negotiation.
pjfanning
reviewed
Nov 26, 2026
pjfanning
left a comment
Member
There was a problem hiding this comment.
Question: the 1023/1024 boundary comes from the test's own lambda (contentLengthOption.exists(_ >= threshold)), so it's testing the test, and "original entity length, before encoding" can't fail since messageFilter always sees the unencoded message. What remains ("a custom messageFilter is honoured") is already covered by EncoderSpec and FlowCoderSpec. Maybe close, or turn it into a docs example?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
A route-local Gzip filter can set a minimum response size. The decision needs the length of the original HTTP response entity, before encoding changes the entity and its length metadata.
Modification
Test a Gzip filter with a 1024-byte minimum on two ordinary typed responses. Verify that the 1023-byte response remains unchanged, while the 1024-byte response is labeled as Gzip and decompresses to the exact original bytes. No production code or default behavior changes.
Result
Covers the inclusive size boundary on the original entity for an opt-in, route-local filter.
Tests
git diff --check, passed.References
RFC 9110 §12.5.3.