diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/xmlrpc/client.rb | 14 |
2 files changed, 12 insertions, 7 deletions
@@ -1,3 +1,8 @@ +Thu Jun 13 22:35:50 2013 Kouhei Sutou <kou@cozmixng.org> + + * lib/xmlrpc/client.rb (XMLRPC::Client#parse_set_cookies): Use + guard style. + Thu Jun 13 22:12:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/fileutils.rb (FileUtils#rmdir): fix traversal loop, not trying diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb index 6a955cdc85..547eca8819 100644 --- a/lib/xmlrpc/client.rb +++ b/lib/xmlrpc/client.rb @@ -512,13 +512,13 @@ module XMLRPC # :nodoc: end def parse_set_cookies(set_cookies) - if set_cookies and !set_cookies.empty? - require 'webrick/cookie' - @cookie = set_cookies.collect do |set_cookie| - cookie = WEBrick::Cookie.parse_set_cookie(set_cookie) - WEBrick::Cookie.new(cookie.name, cookie.value).to_s - end.join("; ") - end + return if set_cookies.nil? + return if set_cookies.empty? + require 'webrick/cookie' + @cookie = set_cookies.collect do |set_cookie| + cookie = WEBrick::Cookie.parse_set_cookie(set_cookie) + WEBrick::Cookie.new(cookie.name, cookie.value).to_s + end.join("; ") end def gen_multicall(methods=[], async=false) |