cookies might be nil (in fact, the default options won't be the same when expanding the options, think about this for a while

This commit is contained in:
HoneyryderChuck 2017-12-19 11:48:51 +02:00
parent 7d9f6f2466
commit 1c507545c1

View File

@ -22,6 +22,7 @@ module HTTPX
module HeadersMethods
def cookies(cookies)
return unless cookies
cookies.each do |k, v|
cookie = k.is_a?(HTTP::Cookie) ? k : HTTP::Cookie.new(k.to_s, v.to_s)
add("cookie", cookie.cookie_value)