Class: HeaderServlet

Inherits:
WEBrick::HTTPServlet::AbstractServlet
  • Object
show all
Defined in:
lib/mechanize/test_case.rb

Instance Method Summary collapse

Instance Method Details

#do_GET(req, res) ⇒ Object



225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/mechanize/test_case.rb', line 225

def do_GET(req, res)
  res['Content-Type'] = "text/html"

  req.query.each do |x,y|
    res[x] = y
  end

  body = ''
  req.each_header do |k,v|
    body << "#{k}|#{v}\n"
  end
  res.body = body
end