lib/async/http/protocol/http1/response.rb in async-http-0.69.0 vs lib/async/http/protocol/http1/response.rb in async-http-0.70.0

- old
+ new

@@ -29,10 +29,11 @@ # @parameter reason [String] HTTP response line reason phrase. 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 def connection