Skip to content

Chucker 3.1.2 re-writing the Server Response; throws IOException when used as a networkInterceptor #242

Closed
@jannisveerkamp

Description

✍️ Describe the bug

After updating to 3.1.2 (from 3.0.1) every request fails with an IOException:

java.io.IOException: ID1ID2: actual 0x00007b22 != expected 0x00001f8b
System.err:     at okio.GzipSource.checkEqual(GzipSource.java:205)
System.err:     at okio.GzipSource.consumeHeader(GzipSource.java:120)
System.err:     at okio.GzipSource.read(GzipSource.java:73)
System.err:     at okio.RealBufferedSource.read(RealBufferedSource.java:51)
System.err:     at okio.ForwardingSource.read(ForwardingSource.java:35)
System.err:     at retrofit2.OkHttpCall$ExceptionCatchingResponseBody$1.read(OkHttpCall.java:288)
System.err:     at okio.RealBufferedSource.select(RealBufferedSource.java:100)

Chucker 3.0.1 returned the original Response. 3.1.x seems to process the response and returns this "processed Response" (see here).

I see the need of processing the Response and doing stuff with it. But the Interceptor has to return the original response at the end, since Chucker is only some kind of debugging ouput, which should not change the Request/Response in any way.

💣 Steps to reproduce

  • Add ChuckerInterceptor as a networkInterceptor
  • I think the Request has to be gzipped

🔧 Expected behavior

  • Chucker should not alter the Server Response

📱 Tech info

Chucker version: 3.1.2
OkHttp version: 3.14.6

📄 Additional context

This only happens when the ChuckerInterceptor is added as a networkInterceptor.
The Notification shows the correct Request with the Response.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions