[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16320085#comment-16320085
 ] 

Sudheera Palihakkara commented on HTTPCLIENT-1895:
--------------------------------------------------

[~sarkara1] Following test passed with the  attached "*multi-test.gz*" file 
which contains two streams of gzip (refer to the hex below)

{code:java}
    @Test
    public void testDecompressionWithMultipleGZipStream() throws IOException {
        final ClassLoader classLoader = getClass().getClassLoader();
        final InputStream in = classLoader.getResourceAsStream("multi-test.gz");
        final InputStreamEntity out = new InputStreamEntity(in);
        GzipDecompressingEntity gunZipEntity = new GzipDecompressingEntity(out);
        Assert.assertEquals("stream-1\nstream-2\n", 
EntityUtils.toString(gunZipEntity, Charset.defaultCharset()));
    }
{code}


{code}
1f8b 0808 03f1 555a 0003 7465 7374 3100
2b2e 294a 4dcc d535 e402 0003 61f0 5f09
0000 001f 8b08 0808 f155 5a00 0374 6573
7432 002b 2e29 4a4d ccd5 35e2 0200 c032
dd74 0900 0000 
{code}

File : [^multi-test.gz]



> GzipDecompressingEntity ignores everything but the first GZIP stream, 
> non-compliant with RFC 1952
> -------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1895
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1895
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 4.5.4
>            Reporter: Abhijit Sarkar
>             Fix For: 4.6 Alpha1
>
>         Attachments: multi-test.gz
>
>
> For a GZIP stream containing multiple sub streams, 
> {{GzipDecompressingEntity}} ignores everything but the first GZIP stream. 
> This is non-compliant behavior with [RFC 
> 1952|https://tools.ietf.org/html/rfc1952]. Quoting section 2.2:
> {quote}
> A gzip file consists of a series of "members" (compressed data sets).  The 
> format of each member is specified in the following section.  The members 
> simply appear one after another in the file, with no additional information 
> before, between, or after them.
> {quote}
> Detailed discussion about this bug can be found in 
> [square/okhttp#3759|https://github.com/square/okhttp/issues/3759], including 
> [comment|https://github.com/square/okhttp/issues/3759#issuecomment-356110268] 
> from Mark Adler, co-author of GZIP.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to