Skip to content

Commit

Permalink
Response protocol should only be a single value. (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix authored Aug 2, 2024
1 parent 3f7b32f commit 498b912
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/async/http/protocol/http1/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def initialize(connection, version, status, reason, headers, body)
@connection = connection
@reason = reason

protocol = headers.delete(UPGRADE)
# Technically, there should never be more than one value for the upgrade header, but we'll just take the first one to avoid complexity.
protocol = headers.delete(UPGRADE)&.first

super(version, status, headers, body, protocol)
end
Expand Down

0 comments on commit 498b912

Please sign in to comment.