Module: HTTPX::Plugins::FollowRedirects::OptionsMethods

Defined in:
lib/httpx/plugins/follow_redirects.rb

Instance Method Summary collapse

Instance Method Details

#option_allow_auth_to_other_origins(value) ⇒ Object



35
36
37
# File 'lib/httpx/plugins/follow_redirects.rb', line 35

def option_allow_auth_to_other_origins(value)
  value
end

#option_follow_insecure_redirects(value) ⇒ Object



31
32
33
# File 'lib/httpx/plugins/follow_redirects.rb', line 31

def option_follow_insecure_redirects(value)
  value
end

#option_max_redirects(value) ⇒ Object

Raises:

  • (TypeError)


24
25
26
27
28
29
# File 'lib/httpx/plugins/follow_redirects.rb', line 24

def option_max_redirects(value)
  num = Integer(value)
  raise TypeError, ":max_redirects must be positive" if num.negative?

  num
end

#option_redirect_on(value) ⇒ Object

Raises:

  • (TypeError)


39
40
41
42
43
# File 'lib/httpx/plugins/follow_redirects.rb', line 39

def option_redirect_on(value)
  raise TypeError, ":redirect_on must be callable" unless value.respond_to?(:call)

  value
end