From db97ed7fb350182756d18121b038a2f93bbdd2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 21 Oct 2020 18:21:39 +0200 Subject: [PATCH] Fix response log marked as request one --- .../owncloud/android/lib/common/http/LogInterceptor.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/LogInterceptor.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/LogInterceptor.kt index 0877deca..0352b821 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/LogInterceptor.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/LogInterceptor.kt @@ -139,7 +139,7 @@ class LogInterceptor : Interceptor { if (!buffer.isProbablyUtf8()) { logHttp( - REQUEST, + RESPONSE, BODY, requestId, "<-- Body end for request -- Binary -- Omitted: ${responseBody.contentLength()} bytes" @@ -147,12 +147,12 @@ class LogInterceptor : Interceptor { } if (responseBody.contentLength() < LIMIT_BODY_LOG) { - logHttp(REQUEST, BODY, requestId, buffer.clone().readString(charset)) + logHttp(RESPONSE, BODY, requestId, buffer.clone().readString(charset)) } else { - logHttp(REQUEST, BODY, requestId, buffer.clone().readString(LIMIT_BODY_LOG, charset)) + logHttp(RESPONSE, BODY, requestId, buffer.clone().readString(LIMIT_BODY_LOG, charset)) } logHttp( - REQUEST, + RESPONSE, BODY, requestId, "<-- Body end for request -- Omitted: ${max(0, responseBody.contentLength() - LIMIT_BODY_LOG)} bytes"