Skip to content

Commit

Permalink
Add request for BR encoded response body
Browse files Browse the repository at this point in the history
  • Loading branch information
Stexxe committed Dec 20, 2024
1 parent 1027b97 commit ecec89e
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,26 @@ class NewFormatTest {
.assertNoMoreLogs()
}

@Test
fun bodyResponseBodyBrEncoded() = testWithLevel(LogLevel.BODY, handle = {
respond(byteArrayOf(0xC3.toByte(), 0x28), headers = Headers.build {
append(HttpHeaders.ContentEncoding, "br")
append(HttpHeaders.ContentLength, "2")
})
}) { client ->
client.get("/")
log.assertLogEqual("--> GET /")
.assertLogEqual("Accept-Charset: UTF-8")
.assertLogEqual("Accept: */*")
.assertLogEqual("--> END GET")
.assertLogMatch(Regex("""<-- 200 OK / \(\d+ms\)"""))
.assertLogEqual("Content-Encoding: br")
.assertLogEqual("Content-Length: 2")
.assertLogEqual("")
.assertLogMatch(Regex("""<-- END HTTP \(\d+ms, binary 2-byte body omitted\)"""))
.assertNoMoreLogs()
}

@Test
fun bodyGzippedResponseBodyContentEncoding() = runTest {
HttpClient(MockEngine) {
Expand Down

0 comments on commit ecec89e

Please sign in to comment.