add default input providers

This commit is contained in:
2022-03-06 18:06:57 +06:00
parent 91927d3b50
commit f5b71dcb84
11 changed files with 78 additions and 34 deletions
client/src/jsMain/kotlin/dev/inmo/postssystem/client/utils
features
common
common
build.gradle
src
commonMain
kotlin
dev
inmo
postssystem
features
jsMain
kotlin
dev
inmo
postssystem
features
jvmMain
kotlin
dev
inmo
postssystem
features
files
common
src
jvmMain
kotlin
dev
inmo
postssystem
features
gradle.properties
gradle
server/src/main/resources/web
services/posts
client
src
commonMain
kotlin
dev
inmo
postssystem
services
server
src
jvmMain
kotlin
dev
inmo
postssystem

@ -45,7 +45,7 @@ class ClientWritePostsService(
when (content) {
is BinaryContent -> append(
i.toString(),
InputProvider(block = content.inputProvider),
InputProvider(block = content.inputProvider::invoke),
headers {
append(HttpHeaders.ContentType, content.mimeType.raw)
append(HttpHeaders.ContentDisposition, "filename=\"${content.filename.name}\"")
@ -86,7 +86,7 @@ class ClientWritePostsService(
when (it) {
is BinaryContent -> append(
i.toString(),
InputProvider(block = it.inputProvider),
InputProvider(block = it.inputProvider::invoke),
headers {
append(HttpHeaders.ContentType, it.mimeType.raw)
append(HttpHeaders.ContentDisposition, "filename=\"${it.filename.name}\"")