Class: InfiniteRefreshServlet

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



260
261
262
263
264
265
# File 'lib/mechanize/test_case.rb', line 260

def do_GET(req, res)
  res['Content-Type'] = req.query['ct'] || "text/html"
  res.status = req.query['code'] ? req.query['code'].to_i : '302'
  number = req.query['q'] ? req.query['q'].to_i : 0
  res['Refresh'] = " 0;url=http://localhost/infinite_refresh?q=#{number + 1}\r\n";
end