/usr/lib/ruby/vendor_ruby/mechanize/test_case/refresh_with_empty_url.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 | class RefreshWithEmptyUrl < WEBrick::HTTPServlet::AbstractServlet
@@count = 0
def do_GET(req, res)
address = "#{req.host}:#{req.port}"
res.content_type = "text/html"
@@count += 1
if @@count > 1
res['Refresh'] = "0; url=http://#{address}/";
else
res['Refresh'] = "0; url=";
end
end
end
|