Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Feb 12, 2024
1 parent 5c51e57 commit a41ede4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public suspend fun dumpRequest(request: HttpRequestBuilder, dumpBody: Boolean):
val skip = setOf("Host", "Content-Length")
request.headers.entries()
.filterNot { it.key in skip }
.forEach { entry ->
buffer.writeUtf8(entry.value.joinToString(separator = ";", prefix = "${entry.key}: ", postfix = "\r\n"))
.forEach { (key, values) ->
buffer.writeUtf8(values.joinToString(separator = ";", prefix = "${key}: ", postfix = "\r\n"))
}

buffer.writeUtf8("\r\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class HttpRequestBuilderTest {
val expectedWithContent = "$expectedNoContent$content"
assertEquals(expectedWithContent, actualWithContent)

val actualReplacedContent = builder.body.readAll()?.decodeToString() ?: fail("expected content")
val actualReplacedContent = assertNotNull(builder.body.readAll()?.decodeToString())
assertEquals(content, actualReplacedContent)
}

Expand Down

0 comments on commit a41ede4

Please sign in to comment.