Module: HTTPX::AltSvc::ConnectionMixin

Defined in:
lib/httpx/altsvc.rb

Overview

makes connections able to accept requests destined to primary service.

Instance Method Summary collapse

Instance Method Details

#match?(uri, options) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
21
# File 'lib/httpx/altsvc.rb', line 17

def match?(uri, options)
  return false if !used? && (@state == :closing || @state == :closed)

  match_altsvcs?(uri) && match_altsvc_options?(uri, options)
end

#send(request) ⇒ Object



11
12
13
14
15
# File 'lib/httpx/altsvc.rb', line 11

def send(request)
  request.headers["alt-used"] = @origin.authority if @parser && !@write_buffer.full? && match_altsvcs?(request.uri)

  super
end