lib/httpx/options.rb in httpx-0.20.5 vs lib/httpx/options.rb in httpx-0.21.0
- old
+ new
@@ -8,10 +8,11 @@
MAX_BODY_THRESHOLD_SIZE = (1 << 10) * 112 # 112K
CONNECT_TIMEOUT = 60
OPERATION_TIMEOUT = 60
KEEP_ALIVE_TIMEOUT = 20
SETTINGS_TIMEOUT = 10
+ READ_TIMEOUT = WRITE_TIMEOUT = REQUEST_TIMEOUT = Float::INFINITY
# https://github.com/ruby/resolv/blob/095f1c003f6073730500f02acbdbc55f83d70987/lib/resolv.rb#L408
ip_address_families = begin
list = Socket.ip_address_list
if list.any? { |a| a.ipv6? && !a.ipv6_loopback? && !a.ipv6_linklocal? }
@@ -32,10 +33,13 @@
:timeout => {
connect_timeout: CONNECT_TIMEOUT,
settings_timeout: SETTINGS_TIMEOUT,
operation_timeout: OPERATION_TIMEOUT,
keep_alive_timeout: KEEP_ALIVE_TIMEOUT,
+ read_timeout: READ_TIMEOUT,
+ write_timeout: WRITE_TIMEOUT,
+ request_timeout: REQUEST_TIMEOUT,
},
:headers => {},
:window_size => WINDOW_SIZE,
:body_threshold_size => MAX_BODY_THRESHOLD_SIZE,
:request_class => Class.new(Request),
@@ -195,20 +199,20 @@
def option_ip_families(value)
Array(value)
end
%i[
- params form json body ssl http2_settings
+ params form json xml body ssl http2_settings
request_class response_class headers_class request_body_class
response_body_class connection_class options_class
io fallback_protocol debug debug_level transport_options resolver_class resolver_options
persistent
].each do |method_name|
def_option(method_name)
end
- REQUEST_IVARS = %i[@params @form @json @body].freeze
+ REQUEST_IVARS = %i[@params @form @xml @json @body].freeze
private_constant :REQUEST_IVARS
def ==(other)
ivars = instance_variables | other.instance_variables
ivars.all? do |ivar|
@@ -261,10 +265,10 @@
else
def initialize_dup(other)
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
end
instance_variable_set(ivar, value)