Skip to content

Commit

Permalink
Compare protocols case-insensitively
Browse files Browse the repository at this point in the history
  • Loading branch information
ryu-sato authored and ioquatix committed Apr 24, 2024
1 parent 1d99486 commit 2acdf97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/async/websocket/upgrade_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2acdf97

Please sign in to comment.