module HTTPX::URIExtensions

  1. lib/httpx/extensions.rb

Methods

Public Instance

  1. altsvc_match?
  2. authority
  3. origin

Public Instance methods

altsvc_match? (uri)
[show source]
   # File lib/httpx/extensions.rb
68 def altsvc_match?(uri)
69   uri = URI.parse(uri)
70 
71   origin == uri.origin || begin
72     case scheme
73     when "h2"
74       (uri.scheme == "https" || uri.scheme == "h2") &&
75       host == uri.host &&
76       (port || default_port) == (uri.port || uri.default_port)
77     else
78       false
79     end
80   end
81 end
authority ()
[show source]
   # File lib/httpx/extensions.rb
59 def authority
60   port_string = port == default_port ? nil : ":#{port}"
61   "#{host}#{port_string}"
62 end
origin ()
[show source]
   # File lib/httpx/extensions.rb
64 def origin
65   "#{scheme}://#{authority}"
66 end