From e268d15e9da467c36cfed954e4987bc1f6a5c6cc Mon Sep 17 00:00:00 2001 From: Joannis Orlandos Date: Mon, 30 Sep 2024 11:50:42 +0200 Subject: [PATCH] Hummingbird 2's semantics changed, requiring body streams to finish the stream explicitly. This currently causes crashes on reused connections --- Sources/OpenAPIHummingbird/OpenAPITransport.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/OpenAPIHummingbird/OpenAPITransport.swift b/Sources/OpenAPIHummingbird/OpenAPITransport.swift index f8ddd9c..2001cb6 100644 --- a/Sources/OpenAPIHummingbird/OpenAPITransport.swift +++ b/Sources/OpenAPIHummingbird/OpenAPITransport.swift @@ -85,6 +85,7 @@ extension Response { for try await buffer in bufferSequence { try await writer.write(buffer) } + try await writer.finish(nil) } } else { responseBody = .init(asyncSequence: bufferSequence)