square / retrofit

A type-safe HTTP client for Android and the JVM

Home Page:https://square.github.io/retrofit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to hide sensitive information from response header?

P01ARPITJ opened this issue · comments

Hello Team,
I am using Retrofit library for Api calls. now i am getting some values in headers response like server details, tokens etc.
is there any way to hide the values from response header.
I thought to add interceptor but i think its work for header request call, not for response.

Hide from whom?

Hi @JakeWharton, Thanks for immediate response.
Actually, I am calling Api and getting success response with body and headers.
Now headers contain some sensitive information's so i want to hide those values.

like in logs :

2024-01-18 16:32:36.803 6625-6934/com.**********.debugD/OkHttp: server_value: "test123445"

so i want to hide this value or change with blank strings.

Retrofit does not perform any logging. If you are using OkHttp's logging-interceptor artifact, however, you can use its redactHeader API to omit sensitive headers from being included in the output.