File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/commonMain/kotlin/com.adamratzman.spotify/http Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -243,13 +243,16 @@ public class HttpRequest constructor(
243
243
}
244
244
245
245
override fun toString (): String {
246
- return """ HttpConnection (
246
+ // we don't want to print this sensitive information
247
+ val headersWithoutAuthorization = headers.filter { it.key != " Authorization" }
248
+ val hasAuthorizationHeader = headersWithoutAuthorization.size != headers.size
249
+ return """ HttpConnection(
247
250
|url=$url ,
248
251
|method=$method ,
249
252
|body=${bodyString ? : bodyMap} ,
250
253
|contentType=$contentType ,
251
- |headers=${headers .toList()}
252
- | )
254
+ |headers=${headersWithoutAuthorization .toList()}
255
+ |${ if (hasAuthorizationHeader) " The authorization header was hidden. " else " There was no authorization header. " } )
253
256
""" .trimMargin()
254
257
}
255
258
You can’t perform that action at this time.
0 commit comments