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