class OneCookieNoSpacesServlet

Public Instance Methods

do_GET(req, res) click to toggle source
# File lib/mechanize/test_case/one_cookie_no_spaces_servlet.rb, line 2
def do_GET(req, res)
  cookie = WEBrick::Cookie.new("foo", "bar")
  cookie.path = "/"
  cookie.expires = Time.now + 86400
  res.cookies << cookie.to_s.gsub(/; /, ';')
  res['Content-Type'] = "text/html"
  res.body = "<html><body>hello</body></html>"
end