We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b85b27d commit 5e11583Copy full SHA for 5e11583
Sources/OpenAPIVapor/Streaming.swift
Sources/OpenAPIVapor/VaporTransport.swift
@@ -145,7 +145,20 @@ extension Vapor.Response.Body {
145
}
146
let stream: @Sendable (any Vapor.BodyStreamWriter) -> () = { writer in
147
_ = writer.eventLoop.makeFutureWithTask {
148
- await Streaming.write(body: body, writer: writer)
+ do {
149
+ for try await chunk in body {
150
+ try await writer.eventLoop.flatSubmit {
151
+ writer.write(.buffer(ByteBuffer(bytes: chunk)))
152
+ }.get()
153
+ }
154
155
+ writer.write(.end)
156
157
+ } catch {
158
159
+ writer.write(.error(error))
160
161
162
163
164
switch body.length {
0 commit comments