Sha256: d4a174e4aaaed95fdeb2dbc2693ab47c88bd2493b0dfa28b4bbb6872d8194bc6

Contents?: true

Size: 946 Bytes

Versions: 8

Compression:

Stored size: 946 Bytes

Contents

# frozen_string_literal: true

module WebSocket
  module Handshake
    module Handler
      class Client < Base
        private

        # @see WebSocket::Handshake::Handler::Base#header_line
        def header_line
          path = @handshake.path
          path += '?' + @handshake.query if @handshake.query
          "GET #{path} HTTP/1.1"
        end

        # @see WebSocket::Handshake::Handler::Base#header_handshake_keys
        def handshake_keys
          super + @handshake.headers.to_a
        end

        # Verify if received header matches with one of the sent ones
        # @return [Boolean] True if matching. False otherwise(appropriate error is set)
        def verify_protocol
          return true if supported_protocols.empty?
          protos = provided_protocols & supported_protocols
          raise WebSocket::Error::Handshake::UnsupportedProtocol if protos.empty?
          true
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/websocket-1.2.10/lib/websocket/handshake/handler/client.rb
websocket-1.2.11 lib/websocket/handshake/handler/client.rb
websocket-1.2.10 lib/websocket/handshake/handler/client.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/websocket-1.2.9/lib/websocket/handshake/handler/client.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/websocket-1.2.9/lib/websocket/handshake/handler/client.rb
websocket-1.2.9 lib/websocket/handshake/handler/client.rb
websocket-1.2.8 lib/websocket/handshake/handler/client.rb
websocket-1.2.7 lib/websocket/handshake/handler/client.rb