Chucker 3.1.2 re-writing the Server Response; throws IOException when used as a networkInterceptor
See original GitHub issue✍️ 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 anetworkInterceptor
- 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:17 (9 by maintainers)
Top Results From Across the Web
https://raw.githubusercontent.com/ChuckerTeam/chuc...
Chucker now shows partially read application responses properly. ... Fix for [#242] with Chucker throwing exceptions when used as `networkInterceptor()`.
Read more >chapter 3 notes filled in.pdf
For example, if the original expression has a negative exponent, then rewrite the expression so that it has no negative exponents, and vice...
Read more >How to build an HTTP interceptor for an Android app ... - Blog
We can do it by overwriting the public Response intercept(Chain chain) throws IOException; method. Our implementation will mimic the original ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we should include it into
3.2.0
. As for ETA - I would say that I would love to see support of GraphQL to release the new version. It seems that I need to dive into that old PR myself, since there is completely no progress or movement for quite a long time.Ok, I pushed one small change to the PR to not rewrite the response at all.
I’ll gladly make some PoC when I find more time as this is rather big change.