我使用tapir + akka http作为服务。其中一个端点下载文件。
val load
: Endpoint[Source[ByteString, Any], Any, Any, AkkaStreams] =
endpoint
.post
.in("load")
.in(streamBody(AkkaStreams)(
Schema(Schema.schemaForByteArray.schemaType),
CodecFormat.OctetStream()
))
.out(???)Gettin警告
在收到请求结束前发送2xx“早期”响应
我怎么用tapir来处理这件事?
发布于 2021-09-09 21:06:32
这就是akka-http:https://github.com/akka/akka-http/issues/2455的问题。
在代码中使用块的Source吗?Akka-http使用消息,当LastChunk被消耗时,它会发送响应,甚至不会使用LastChunk之后的MessageEnd。
MessageEnd未被消耗,messageEndPending被设置为true,因此会发出早期响应的警告。
我通过过滤LastChunk并将其连接到流的末尾--在MessageEnd之后--从而强制akka使用MessageEnd。
https://stackoverflow.com/questions/69120451
复制相似问题