Sha256: 2243ab49acab0c7824ad1362a64ddd960d283faa7824cd473bfe4f3a6257704d
Contents?: true
Size: 658 Bytes
Versions: 7
Compression:
Stored size: 658 Bytes
Contents
module Reel class Request class Info CASE_INSENSITVE_HASH = Hash.new do |hash, key| hash[hash.keys.find {|k| k =~ /#{key}/i}] if key end attr_reader :http_method, :url, :http_version, :headers def initialize(http_method, url, http_version, headers) @http_method = http_method @url = url @http_version = http_version @headers = CASE_INSENSITVE_HASH.merge headers end UPGRADE = 'Upgrade'.freeze WEBSOCKET = 'websocket'.freeze def websocket_request? headers[UPGRADE] && headers[UPGRADE].downcase == WEBSOCKET end end end end
Version data entries
7 entries across 7 versions & 1 rubygems