Не подтверждена Коммит 72d71ccb создал по автору Rustam's avatar Rustam Зафиксировано автором GitHub
Просмотр файлов

KTOR-6281 Darwin: EOFException when sending multipart data using Ktor (#3782)

владелец 127a0ca2
......@@ -247,6 +247,26 @@ class ContentTest : ClientLoader(5 * 60) {
}
}
@Test
fun testLargeFormWithBinaryData() = clientTests {
val formData = {
formData {
append(
key = "image",
value = ByteArray(100 * 1024) { 0 },
headers = Headers.build {
append(HttpHeaders.ContentType, "image/jpeg")
append(HttpHeaders.ContentDisposition, "filename=image.jpeg")
},
)
}
}
test { client ->
client.submitFormWithBinaryData("$TEST_SERVER/content/upload", formData()).body<ByteArray>()
}
}
@Test
fun testMultipartWithByteReadChannel() = clientTests {
test { client ->
......
......@@ -129,7 +129,7 @@ internal class ByteChannelNative(
awaitSuspend(1)
}
if (!readable.canRead()) {
if (readable.remaining < availableForRead) {
prepareFlushedBytes()
}
......
......@@ -178,7 +178,6 @@ internal val DecompressionListAttribute: AttributeKey<List<String>> = AttributeK
public val ApplicationRequest.appliedDecoders: List<String>
get() = call.attributes.getOrNull(DecompressionListAttribute) ?: emptyList()
private fun PipelineResponse.isSSEResponse(): Boolean {
return headers[HttpHeaders.ContentType] == ContentType.Text.EventStream.toString()
}
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать