Sha256: 2bea03b62e08124847bf23df9b7d243a87913e071e9be5772fded49609a92f8c

Contents?: true

Size: 397 Bytes

Versions: 15

Compression:

Stored size: 397 Bytes

Contents

# frozen_string_literal: true
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 & 1 rubygems

Version Path
mechanize-2.12.2 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.12.1 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.12.0 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.11.0 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.10.1 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.10.0 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.9.2 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.9.1 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.9.0 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.8.5 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.8.4 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.8.3 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.8.2 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.8.1 lib/mechanize/test_case/infinite_redirect_servlet.rb
mechanize-2.8.0 lib/mechanize/test_case/infinite_redirect_servlet.rb