https://bz.apache.org/bugzilla/show_bug.cgi?id=69575

            Bug ID: 69575
           Summary: org.apache.coyote.CompressionConfig doesn't recognize
                    "zstd" compression
           Product: Tomcat 9
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: todo...@gmail.com
  Target Milestone: -----

When a response is already compressed with "zstd" compression algorithm,
org.apache.coyote.CompressionConfig doesn't recognize it, applies "gzip"
compression
ontop of "zstd" and then overrides "Content-Encoding" with "gzip" value.

If gzip is applied ontop of zstd, the content-encoding value should be "zstd,
gzip"
instead of only gzip, but ideally if the response is already encoded with zstd, 
tomcat shouldn't apply gzip ontop of it.

At the moment if the response is already encoded and tomcat applies gzip on top
of
the existing encoding and doesn't preserve the original encoding in the header
"content-encoding" value, the browser (or another client) just decompress the
response with gzip and receives data that it doesn't know how to decode because
the value from the header is erased from tomcat server.

Reference:
https://github.com/apache/tomcat/blob/main/java/org/apache/coyote/CompressionConfig.java#L211
here only gzip and br are checked before encoding.

https://github.com/apache/tomcat/blob/main/java/org/apache/coyote/CompressionConfig.java#L290C35-L290C51
here only gzip is set as content-encoding.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to