Sha256: 69094ec0385494e0433f15cd4e2f9954d16c7e7682b2bf66524a9276ee8d354f

Contents?: true

Size: 400 Bytes

Versions: 17

Compression:

Stored size: 400 Bytes

Contents

# frozen_string_literal: true
class ResponseCodeServlet < WEBrick::HTTPServlet::AbstractServlet
  def do_GET(req, res)
    res['Content-Type'] = req.query['ct'] || "text/html"
    if req.query['code']
      code = req.query['code'].to_i
      case code
      when 300, 301, 302, 303, 304, 305, 307
        res['Location'] = "/index.html"
      end
      res.status = code
    else
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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