Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ class HttpLoggingInterceptor
private fun bodyHasUnknownEncoding(headers: Headers): Boolean {
val contentEncoding = headers["Content-Encoding"] ?: return false
return !contentEncoding.equals("identity", ignoreCase = true) &&
!contentEncoding.equals("gzip", ignoreCase = true)
!contentEncoding.equals("gzip", ignoreCase = true) &&
!contentEncoding.equals("br", ignoreCase = true)
}

private fun bodyIsStreaming(response: Response): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class HttpLoggingInterceptorTest {
server.enqueue(
MockResponse
.Builder() // It's invalid to return this if not requested, but the server might anyway
.setHeader("Content-Encoding", "br")
.setHeader("Content-Encoding", "xyz")
.setHeader("Content-Type", PLAIN)
.body(Buffer().write("iwmASGVsbG8sIEhlbGxvLCBIZWxsbwoD".decodeBase64()!!))
.build(),
Expand All @@ -676,7 +676,7 @@ class HttpLoggingInterceptorTest {
.assertLogMatch(Regex("""User-Agent: okhttp/.+"""))
.assertLogEqual("--> END GET")
.assertLogMatch(Regex("""<-- 200 OK $url \(\d+ms\)"""))
.assertLogEqual("Content-Encoding: br")
.assertLogEqual("Content-Encoding: xyz")
.assertLogEqual("Content-Type: text/plain; charset=utf-8")
.assertLogMatch(Regex("""Content-Length: \d+"""))
.assertLogEqual("<-- END HTTP (encoded body omitted)")
Expand All @@ -685,7 +685,7 @@ class HttpLoggingInterceptorTest {
.assertLogEqual("--> GET $url")
.assertLogEqual("--> END GET")
.assertLogMatch(Regex("""<-- 200 OK $url \(\d+ms\)"""))
.assertLogEqual("Content-Encoding: br")
.assertLogEqual("Content-Encoding: xyz")
.assertLogEqual("Content-Type: text/plain; charset=utf-8")
.assertLogMatch(Regex("""Content-Length: \d+"""))
.assertLogEqual("<-- END HTTP (encoded body omitted)")
Expand Down