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 {
275275 case . end:
276276 precondition ( requestHead != nil , " Received .end without .head " )
277277
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
281285 try await self . processRequestAndSendResponse (
282286 head: requestHead,
283287 body: requestBody,
284288 outbound: outbound,
285289 logger: logger
286290 )
287- } else {
288- await self . responsePool. push (
289- LocalServerResponse ( id: requestId, final: true )
290- )
291-
292291 }
293292
293+ // reset the request state for next request
294294 requestHead = nil
295295 requestBody = nil
296296 requestId = nil
You can’t perform that action at this time.
0 commit comments