Skip to content

Commit

Permalink
Copy protocol if successful.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 3, 2024
1 parent 9dffa99 commit 5c338e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/async/http/protocol/http2/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def receive_initial_headers(headers, end_stream)
@response.status = status
@headers = ::Protocol::HTTP::Headers.new

# If the protocol request was successful, ensure the response protocol matches:
if status == 200 and protocol = @response.request.protocol
@response.protocol = Array(protocol).first
end

headers.each do |key, value|
# It's guaranteed that this should be the first header:
if key == CONTENT_LENGTH
Expand Down

0 comments on commit 5c338e3

Please sign in to comment.