File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -275,22 +275,22 @@ internal struct LambdaHTTPServer {
275
275
case . end:
276
276
precondition ( requestHead != nil , " Received .end without .head " )
277
277
278
- // process the buffered response for non streaming requests
279
- if !self . isStreamingResponse ( requestHead) {
280
- // process the request and send the response
278
+ if self . isStreamingResponse ( requestHead) {
279
+ // for streaming response, send the final response
280
+ await self . responsePool. push (
281
+ LocalServerResponse ( id: requestId, final: true )
282
+ )
283
+ } else {
284
+ // process the buffered response for non streaming requests
281
285
try await self . processRequestAndSendResponse (
282
286
head: requestHead,
283
287
body: requestBody,
284
288
outbound: outbound,
285
289
logger: logger
286
290
)
287
- } else {
288
- await self . responsePool. push (
289
- LocalServerResponse ( id: requestId, final: true )
290
- )
291
-
292
291
}
293
292
293
+ // reset the request state for next request
294
294
requestHead = nil
295
295
requestBody = nil
296
296
requestId = nil
You can’t perform that action at this time.
0 commit comments