/usr/lib/ruby/vendor_ruby/mechanize/test_case/modified_since_servlet.rb is in ruby-mechanize 2.7.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | class ModifiedSinceServlet < WEBrick::HTTPServlet::AbstractServlet
def do_GET(req, res)
s_time = 'Fri, 04 May 2001 00:00:38 GMT'
my_time = Time.parse(s_time)
if req['If-Modified-Since']
your_time = Time.parse(req['If-Modified-Since'])
if my_time > your_time
res.body = 'This page was updated since you requested'
else
res.status = 304
end
else
res.body = 'You did not send an If-Modified-Since header'
end
res['Last-Modified'] = s_time
end
end
|