Skip to content

Commit

Permalink
Ensure upgrade and tunnel responses correctly exit the request loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 4, 2024
1 parent 6f2d6e1 commit abfd8cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/async/http/protocol/http1/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def each(task: Task.current)
request = nil unless request.body
response = nil

body.call(stream)
# We must return here as no further request processing can be done:
return body.call(stream)
else
write_response(@version, response.status, response.headers)

Expand All @@ -82,7 +83,8 @@ def each(task: Task.current)
request = nil unless request.body
response = nil

body.call(stream)
# We must return here as no further request processing can be done:
return body.call(stream)
else
head = request.head?
version = request.version
Expand Down

0 comments on commit abfd8cf

Please sign in to comment.