adds support for the following options:
:max_redirects |
max number of times a request will be redirected (defaults to |
:follow_insecure_redirects |
whether redirects to an “http://” URI, when coming from an “https//”, are allowed (defaults to |
:allow_auth_to_other_origins |
whether auth-related headers, such as “Authorization”, are propagated on redirection (defaults to |
:redirect_on |
optional callback which receives the redirect location and can halt the redirect chain if it returns |
Methods
Public Instance
Public Instance methods
option_allow_auth_to_other_origins(value)
[show source]
# File lib/httpx/plugins/follow_redirects.rb 48 def option_allow_auth_to_other_origins(value) 49 value 50 end
option_follow_insecure_redirects(value)
[show source]
# File lib/httpx/plugins/follow_redirects.rb 44 def option_follow_insecure_redirects(value) 45 value 46 end
option_max_redirects(value)
[show source]
# File lib/httpx/plugins/follow_redirects.rb 37 def option_max_redirects(value) 38 num = Integer(value) 39 raise TypeError, ":max_redirects must be positive" if num.negative? 40 41 num 42 end
option_redirect_on(value)
[show source]
# File lib/httpx/plugins/follow_redirects.rb 52 def option_redirect_on(value) 53 raise TypeError, ":redirect_on must be callable" unless value.respond_to?(:call) 54 55 value 56 end