Skip to content

Fix for Empty Response Body and 0 Content Lenght#206

Merged
vbuberen merged 6 commits into
developfrom
fix-cortinico-response-body
Jan 25, 2020
Merged

Fix for Empty Response Body and 0 Content Lenght#206
vbuberen merged 6 commits into
developfrom
fix-cortinico-response-body

Conversation

@cortinico

@cortinico cortinico commented Jan 24, 2020

Copy link
Copy Markdown
Member

Fixes a bug introduce by me in #198, when implementing clone of the okio.Buffer from the HTTP Response.

Looks like the problem on our end what that we were using ChuckerInterceptor as first interceptors, so the Sample App showed valid results. Switching order of the interceptors showed that responses are null and the approach followed for the .clone() was not correct. I reimplemented it following the HttpLoggingInterceptor body.

How to test

Remove the fix I applied on ChuckerInterceptor and keep only the changes I applied in the sample app. It should break and show null in the response body.

Fixes #203
Closes #205

I've rewrote the processResponseBody following the
body of HttpLoggingInterceptor.
@cortinico cortinico added the bug Something isn't working label Jan 24, 2020
@cortinico cortinico added this to the 3.1.1 milestone Jan 24, 2020
@cortinico cortinico requested a review from vbuberen January 24, 2020 23:51
@cortinico cortinico self-assigned this Jan 24, 2020
Comment thread sample/src/main/res/xml/network_security_config.xml Outdated
Comment thread library/src/main/java/com/chuckerteam/chucker/api/ChuckerInterceptor.kt Outdated
Comment thread library/src/main/java/com/chuckerteam/chucker/api/ChuckerInterceptor.kt Outdated
@vbuberen vbuberen mentioned this pull request Jan 25, 2020

@vbuberen vbuberen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

@vbuberen vbuberen merged commit d0cca85 into develop Jan 25, 2020
@vbuberen vbuberen deleted the fix-cortinico-response-body branch January 25, 2020 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version 3.1.0 always claims that response body is empty

2 participants