mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
fixes on existing plugin option checks
This commit is contained in:
parent
daf9fcee1d
commit
7819079b71
@ -267,7 +267,7 @@ module HTTPX
|
||||
instance_variables.each do |ivar|
|
||||
value = other.instance_variable_get(ivar)
|
||||
value = case value
|
||||
when Symbol, Fixnum, TrueClass, FalseClass # rubocop:disable Lint/UnifiedInteger
|
||||
when Symbol, Numeric, TrueClass, FalseClass
|
||||
value
|
||||
else
|
||||
value.dup
|
||||
|
@ -22,7 +22,7 @@ module HTTPX
|
||||
|
||||
module OptionsMethods
|
||||
def option_expect_timeout(value)
|
||||
seconds = Integer(value)
|
||||
seconds = Float(value)
|
||||
raise TypeError, ":expect_timeout must be positive" unless seconds.positive?
|
||||
|
||||
seconds
|
||||
|
@ -67,7 +67,7 @@ module HTTPX
|
||||
end
|
||||
|
||||
def option_retry_on(value)
|
||||
raise ":retry_on must be called with the response" unless value.respond_to?(:call)
|
||||
raise TypeError, ":retry_on must be called with the response" unless value.respond_to?(:call)
|
||||
|
||||
value
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user