diff --git a/README.md b/README.md index 764ae85..0616e72 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,17 @@ Pick a UI implementation and add the dependency: ````java dependencies { - debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.6' - releaseImplementation 'com.github.kernel0x.finch:noop:2.2.6' + debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.7' + releaseImplementation 'com.github.kernel0x.finch:noop:2.2.7' // optional only for OkHttp - debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.6' - releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.6' + debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.7' + releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.7' // optional only for GRPC - debugImplementation 'com.github.kernel0x.finch:log-grpc:2.2.6' - releaseImplementation 'com.github.kernel0x.finch:log-grpc-noop:2.2.6' + debugImplementation 'com.github.kernel0x.finch:log-grpc:2.2.7' + releaseImplementation 'com.github.kernel0x.finch:log-grpc-noop:2.2.7' // optional only for logs - debugImplementation 'com.github.kernel0x.finch:log:2.2.6' - releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.6' + debugImplementation 'com.github.kernel0x.finch:log:2.2.7' + releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.7' } ```` diff --git a/common-loggers/src/main/java/com/kernel/finch/common/loggers/data/models/NetworkLogEntity.kt b/common-loggers/src/main/java/com/kernel/finch/common/loggers/data/models/NetworkLogEntity.kt index 1f03928..21e349e 100755 --- a/common-loggers/src/main/java/com/kernel/finch/common/loggers/data/models/NetworkLogEntity.kt +++ b/common-loggers/src/main/java/com/kernel/finch/common/loggers/data/models/NetworkLogEntity.kt @@ -7,7 +7,7 @@ import com.google.gson.reflect.TypeToken import com.kernel.finch.common.loggers.data.models.NetworkLogEntity.Companion.TABLE_NAME import com.kernel.finch.common.loggers.utils.FormatUtil import com.kernel.finch.common.loggers.utils.GsonUtil -import java.util.* +import java.util.Locale @Suppress("TooManyFunctions") @Keep @@ -73,6 +73,15 @@ data class NetworkLogEntity( responseHeaders = GsonUtil.instance.toJson(headers) } + fun addResponseHeaders(headers: List) { + setResponseHeaders( + arrayListOf().apply { + addAll(getResponseHeadersAsList() ?: emptyList()) + addAll(headers) + } + ) + } + fun getResponseHeadersAsList(): List? { return GsonUtil.instance.fromJson>( responseHeaders, diff --git a/dependencies.gradle b/dependencies.gradle index 544de6a..664cc56 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,8 +2,8 @@ ext.versions = [ minSdk : 21, targetSdk : 34, compileSdk : 34, - libraryVersion : '2.2.6', - libraryVersionCode: 13, + libraryVersion : '2.2.7', + libraryVersionCode: 14, okhttp3 : '3.7.0', gson : '2.8.2', diff --git a/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt b/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt index 97878d4..2a11432 100644 --- a/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt +++ b/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt @@ -76,7 +76,7 @@ internal class FinchClientInterceptor : ClientInterceptor { if (status.description?.isNotEmpty() == true) { networkLog.responseMessage += " (" + status.description + ")" } - networkLog.setResponseHeaders(toHttpHeaderList(trailers)) + networkLog.addResponseHeaders(toHttpHeaderList(trailers)) FinchGrpcLogger.logNetworkEvent(networkLog) super.onClose(status, trailers) } diff --git a/sample/build.gradle b/sample/build.gradle index 7b18e21..abb6957 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -29,12 +29,12 @@ android { } dependencies { - //debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.6' - //releaseImplementation 'com.github.kernel0x.finch:noop:2.2.6' - //debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.6' - //releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.6' - //debugImplementation 'com.github.kernel0x.finch:log:2.2.6' - //releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.6' + //debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.7' + //releaseImplementation 'com.github.kernel0x.finch:noop:2.2.7' + //debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.7' + //releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.7' + //debugImplementation 'com.github.kernel0x.finch:log:2.2.7' + //releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.7' debugImplementation project(":ui-drawer") debugImplementation project(":log") debugImplementation project(":log-okhttp")