mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
fixed bug related to return on instance_exec evaluation, which was disallowed in that context
This commit is contained in:
parent
ad49df8b34
commit
c744c431fb
@ -17,14 +17,18 @@ module HTTPX
|
||||
def self.extra_options(options)
|
||||
Class.new(options.class) do
|
||||
def_option(:cookies) do |cookies|
|
||||
return cookies if cookies.is_a?(Store)
|
||||
|
||||
Store.new(cookies)
|
||||
end
|
||||
end.new(options)
|
||||
end
|
||||
|
||||
class Store
|
||||
def self.new(cookies = nil)
|
||||
return cookies if cookies.is_a?(self)
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
def initialize(cookies = nil)
|
||||
@store = Hash.new { |hash, origin| hash[origin] = HTTP::CookieJar.new }
|
||||
return unless cookies
|
||||
|
Loading…
x
Reference in New Issue
Block a user