logbook icon indicating copy to clipboard operation
logbook copied to clipboard

Response Body logging problem when response header's content-encoding value is gzip in zalando Netty Logbook

Open stantan2023 opened this issue 3 years ago • 0 comments

Response Body logging problem when response header's content-encoding value is gzip in zalando Netty Logbook

When Request Body header's Transfer-encoding value gzip, if response Header's content-encoding value is gzip Response body value is logged as zipped. But we want to log response body as plain text. I use Spring Cloud Gateway Server 3.1.3 with org.zalando.logbook.netty.LogbookClientHandler http client handler class.

Response Body Logging Gzip problem

İf the server zipped response body, zalando netty log book api cannot log response body as plain text. But I must persist response body as plain text.

Can you modify org.zalando.logbook.netty.Response ?

I import all zalando logbook netty classes into my project. And then in org.zalando.logbook.netty.Response class' getBody method, I convert zipped byte array to plain byte array. So I can log Response body as plain text.

ResponseGetBody

Environment

Java 11 Spring boot 2.7.2 Spring Cloud Gateway Server 3.1.3 logbook-netty-2.14.0 zipped_content

stantan2023 avatar Aug 23 '22 06:08 stantan2023