From 2950de29e5308834fba8f74717c1dc1cb1d9c3dd Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 09:59:05 +0600 Subject: [PATCH] fixes --- .../micro_utils/ktor/server/ServerRoutingShortcuts.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt b/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt index 962f72e2404..2295efef725 100644 --- a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt +++ b/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt @@ -119,6 +119,7 @@ suspend fun ApplicationCall.uniload( suspend fun ApplicationCall.uniloadMultipart( onFormItem: (PartData.FormItem) -> Unit = {}, onCustomFileItem: (PartData.FileItem) -> Unit = {}, + onBinaryChannelItem: (PartData.BinaryChannelItem) -> Unit = {}, onBinaryContent: (PartData.BinaryItem) -> Unit = {} ) = safely { val multipartData = receiveMultipart() @@ -135,6 +136,7 @@ suspend fun ApplicationCall.uniloadMultipart( } } is PartData.BinaryItem -> onBinaryContent(it) + is PartData.BinaryChannelItem -> onBinaryChannelItem(it) } } @@ -145,6 +147,7 @@ suspend fun ApplicationCall.uniloadMultipart( deserializer: DeserializationStrategy, onFormItem: (PartData.FormItem) -> Unit = {}, onCustomFileItem: (PartData.FileItem) -> Unit = {}, + onBinaryChannelItem: (PartData.BinaryChannelItem) -> Unit = {}, onBinaryContent: (PartData.BinaryItem) -> Unit = {} ): Pair { var data: Optional? = null @@ -157,6 +160,7 @@ suspend fun ApplicationCall.uniloadMultipart( onCustomFileItem(it) } }, + onBinaryChannelItem, onBinaryContent ) @@ -168,6 +172,7 @@ suspend fun ApplicationCall.uniloadMultipartFile( deserializer: DeserializationStrategy, onFormItem: (PartData.FormItem) -> Unit = {}, onCustomFileItem: (PartData.FileItem) -> Unit = {}, + onBinaryChannelItem: (PartData.BinaryChannelItem) -> Unit = {}, onBinaryContent: (PartData.BinaryItem) -> Unit = {}, ) = safely { val multipartData = receiveMultipart() @@ -204,6 +209,7 @@ suspend fun ApplicationCall.uniloadMultipartFile( } } is PartData.BinaryItem -> onBinaryContent(it) + is PartData.BinaryChannelItem -> onBinaryChannelItem(it) } } @@ -214,6 +220,7 @@ suspend fun ApplicationCall.uniloadMultipartFile( suspend fun ApplicationCall.uniloadMultipartFile( onFormItem: (PartData.FormItem) -> Unit = {}, onCustomFileItem: (PartData.FileItem) -> Unit = {}, + onBinaryChannelItem: (PartData.BinaryChannelItem) -> Unit = {}, onBinaryContent: (PartData.BinaryItem) -> Unit = {}, ) = safely { val multipartData = receiveMultipart() @@ -247,6 +254,7 @@ suspend fun ApplicationCall.uniloadMultipartFile( } } is PartData.BinaryItem -> onBinaryContent(it) + is PartData.BinaryChannelItem -> onBinaryChannelItem(it) } }