Class: OneCookieNoSpacesServlet

Inherits:
WEBrick::HTTPServlet::AbstractServlet
  • Object
show all
Defined in:
lib/mechanize/test_case.rb

Instance Method Summary collapse

Instance Method Details

#do_GET(req, res) ⇒ Object



390
391
392
393
394
395
396
397
# File 'lib/mechanize/test_case.rb', line 390

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