Sha256: 356e75893a9792659f6615998a8c8cc7202bc99dd69a002f959ce218ed76a6be

Contents?: true

Size: 466 Bytes

Versions: 6

Compression:

Stored size: 466 Bytes

Contents

module Reel
  class RequestInfo
    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      = headers
    end

    UPGRADE   = 'Upgrade'.freeze
    WEBSOCKET = 'websocket'.freeze

    def websocket_request?
      headers[UPGRADE] && headers[UPGRADE].downcase == WEBSOCKET
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reel-0.4.0 lib/reel/request_info.rb
reel-0.4.0.pre7 lib/reel/request_info.rb
reel-0.4.0.pre6 lib/reel/request_info.rb
reel-0.4.0.pre5 lib/reel/request_info.rb
reel-0.4.0.pre4 lib/reel/request_info.rb
reel-0.4.0.pre3 lib/reel/request_info.rb