From 2acdf97fb7b9cd338909c4ad21b767a11f4df818 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sat, 13 Apr 2024 02:42:34 +0900 Subject: [PATCH] Compare protocols case-insensitively --- lib/async/websocket/upgrade_request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/async/websocket/upgrade_request.rb b/lib/async/websocket/upgrade_request.rb index 817a37b..c79e04d 100644 --- a/lib/async/websocket/upgrade_request.rb +++ b/lib/async/websocket/upgrade_request.rb @@ -76,7 +76,7 @@ def call(connection) raise ProtocolError, "Invalid accept digest, expected #{expected_accept_digest.inspect}, got #{accept_digest.inspect}!" end end - verified = accept_digest && Array(response.protocol) == %w(websocket) && response.headers['connection']&.include?('upgrade') + verified = accept_digest && Array(response.protocol).map(&:downcase) == %w(websocket) && response.headers['connection']&.include?('upgrade') return Wrapper.new(response, verified: verified) end