1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-24 18:41:06 +03:00

Convert HttpHeaders to Kotlin (#5016)

* Rename HttpHeaders.java to .kt

* Convert HttpHeaders to Kotlin
This commit is contained in:
Jesse Wilson
2019-05-06 20:50:19 -04:00
committed by GitHub
parent 981639ac55
commit b46f891a52
12 changed files with 421 additions and 446 deletions

View File

@@ -19,7 +19,7 @@ import okhttp3.Headers
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.Response
import okhttp3.internal.http.HttpHeaders
import okhttp3.internal.http.promisesBody
import okhttp3.internal.platform.Platform
import okhttp3.internal.platform.Platform.Companion.INFO
import okio.Buffer
@@ -235,7 +235,7 @@ class HttpLoggingInterceptor @JvmOverloads constructor(
logHeader(headers, i)
}
if (!logBody || !HttpHeaders.hasBody(response)) {
if (!logBody || !response.promisesBody()) {
logger.log("<-- END HTTP")
} else if (bodyHasUnknownEncoding(response.headers())) {
logger.log("<-- END HTTP (encoded body omitted)")