Class: RedirectServlet

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

Instance Method Summary collapse

Instance Method Details

#do_GET(req, res) ⇒ Object Also known as: do_POST, do_HEAD, do_PUT, do_DELETE



3
4
5
6
7
# File 'lib/mechanize/test_case/redirect_servlet.rb', line 3

def do_GET(req, res)
  res['Content-Type'] = req.query['ct'] || 'text/html'
  res.status = req.query['code'] ? req.query['code'].to_i : '302'
  res['Location'] = req['X-Location'] || '/verb'
end