Sha256: 29fa331a786578e008eb640e6c7a3c0086fed4bb5c4d281b9e9b0ac13704f74a

Contents?: true

Size: 367 Bytes

Versions: 15

Compression:

Stored size: 367 Bytes

Contents

class InfiniteRedirectServlet < WEBrick::HTTPServlet::AbstractServlet
  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['Location'] = "/infinite_redirect?q=#{number + 1}"
  end
  alias :do_POST :do_GET
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
mechanize-2.7.7 lib/mechanize/test_case/infinite_redirect_servlet.rb
husc-0.2.1 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/test_case/infinite_redirect_servlet.rb
husc-0.2.0 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/test_case/infinite_redirect_servlet.rb
husc-0.1.1 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/test_case/infinite_redirect_servlet.rb
husc-0.1.0 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.7.6 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.7.5 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.7.4 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.7.3 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.7.2 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.7.1 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.7.0 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.6.0 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.5.1 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.5 lib/mechanize/test_case/infinite_redirect_servlet.rb