1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

extract out options assignment to method

This commit is contained in:
Mark Lehman 2015-08-24 15:46:07 -07:00
parent 06e4dcdaed
commit 58fc195b6f

View file

@ -519,9 +519,7 @@ module HTTParty
# Perform a HEAD request to a path
def head(path, options = {}, &block)
unless options.has_key?(:maintain_method_across_redirects)
options[:maintain_method_across_redirects] = true
end
ensure_method_maintained_across_redirects options
perform_request Net::HTTP::Head, path, options, &block
end
@ -534,6 +532,12 @@ module HTTParty
private
def ensure_method_maintained_across_redirects(options)
unless options.has_key? :maintain_method_across_redirects
options[:maintain_method_across_redirects] = true
end
end
def perform_request(http_method, path, options, &block) #:nodoc:
options = ModuleInheritableAttributes.hash_deep_dup(default_options).merge(options)
process_headers(options)