Skip to content

Commit 498b912

Browse files
authored
Response protocol should only be a single value. (#162)
1 parent 3f7b32f commit 498b912

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/async/http/protocol/http1/response.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def initialize(connection, version, status, reason, headers, body)
3131
@connection = connection
3232
@reason = reason
3333

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

3637
super(version, status, headers, body, protocol)
3738
end

0 commit comments

Comments
 (0)