Sha256: 95b8b4a6096b7ee0a46b2f14cf3c77841057c2fd15cdc60066efbb40041a208b

Contents?: true

Size: 371 Bytes

Versions: 15

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true
class SendCookiesServlet < WEBrick::HTTPServlet::AbstractServlet
  def do_GET(req, res)
    res.content_type = 'text/html'

    cookies = req.cookies.map do |c|
      "<li><a href=\"#\">#{c.name}:#{c.value}</a>"
    end.join "\n"

    res.body = <<-BODY
<!DOCTYPE html>
<title>Your cookies</title>

<ul>
#{cookies}
</ul>
    BODY
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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