From 498b9126480dc4342b05a4e674a621ebed3ee65b Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Fri, 2 Aug 2024 17:18:00 +1200 Subject: [PATCH] Response protocol should only be a single value. (#162) --- lib/async/http/protocol/http1/response.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/async/http/protocol/http1/response.rb b/lib/async/http/protocol/http1/response.rb index 6027e199..7f30464e 100644 --- a/lib/async/http/protocol/http1/response.rb +++ b/lib/async/http/protocol/http1/response.rb @@ -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