public Method

HTTPProxyServer.set_cookie(src, dst)

Net::HTTP is stupid about the multiple header fields. Here is workaround:

Source Code

# File webrick/httpproxy.rb, line 72
def set_cookie(src, dst)
  if str = src['set-cookie']
    cookies = []
    str.split(/,\s*/).each{|token|
      if /^[^=]+;/o =~ token
        cookies[-1] << ", " << token
      elsif /=/o =~ token
        cookies << token
      else
        cookies[-1] << ", " << token
      end
    }
    dst.cookies.replace(cookies)
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.