X7ROOT File Manager
Current Path:
/opt/alt/ruby18/lib64/ruby/1.8/webrick
opt
/
alt
/
ruby18
/
lib64
/
ruby
/
1.8
/
webrick
/
??
..
??
accesslog.rb
(2.25 KB)
??
cgi.rb
(6.92 KB)
??
compat.rb
(436 B)
??
config.rb
(3.13 KB)
??
cookie.rb
(3.03 KB)
??
htmlutils.rb
(584 B)
??
httpauth
??
httpauth.rb
(1.31 KB)
??
httpproxy.rb
(7.46 KB)
??
httprequest.rb
(9.99 KB)
??
httpresponse.rb
(7.96 KB)
??
https.rb
(1.64 KB)
??
httpserver.rb
(5.63 KB)
??
httpservlet
??
httpservlet.rb
(669 B)
??
httpstatus.rb
(3.51 KB)
??
httputils.rb
(9.96 KB)
??
httpversion.rb
(1.12 KB)
??
log.rb
(2.03 KB)
??
server.rb
(5.28 KB)
??
ssl.rb
(4.22 KB)
??
utils.rb
(2.54 KB)
??
version.rb
(351 B)
Editing: accesslog.rb
# # accesslog.rb -- Access log handling utilities # # Author: IPR -- Internet Programming with Ruby -- writers # Copyright (c) 2002 keita yamaguchi # Copyright (c) 2002 Internet Programming with Ruby writers # # $IPR: accesslog.rb,v 1.1 2002/10/01 17:16:32 gotoyuzo Exp $ module WEBrick module AccessLog class AccessLogError < StandardError; end CLF_TIME_FORMAT = "[%d/%b/%Y:%H:%M:%S %Z]" COMMON_LOG_FORMAT = "%h %l %u %t \"%r\" %s %b" CLF = COMMON_LOG_FORMAT REFERER_LOG_FORMAT = "%{Referer}i -> %U" AGENT_LOG_FORMAT = "%{User-Agent}i" COMBINED_LOG_FORMAT = "#{CLF} \"%{Referer}i\" \"%{User-agent}i\"" module_function # This format specification is a subset of mod_log_config of Apache. # http://httpd.apache.org/docs/mod/mod_log_config.html#formats def setup_params(config, req, res) params = Hash.new("") params["a"] = req.peeraddr[3] params["b"] = res.sent_size params["e"] = ENV params["f"] = res.filename || "" params["h"] = req.peeraddr[2] params["i"] = req params["l"] = "-" params["m"] = req.request_method params["n"] = req.attributes params["o"] = res params["p"] = req.port params["q"] = req.query_string params["r"] = req.request_line.sub(/\x0d?\x0a\z/o, '') params["s"] = res.status # won't support "%>s" params["t"] = req.request_time params["T"] = Time.now - req.request_time params["u"] = req.user || "-" params["U"] = req.unparsed_uri params["v"] = config[:ServerName] params end def format(format_string, params) format_string.gsub(/\%(?:\{(.*?)\})?>?([a-zA-Z%])/){ param, spec = $1, $2 case spec[0] when ?e, ?i, ?n, ?o raise AccessLogError, "parameter is required for \"#{spec}\"" unless param (param = params[spec][param]) ? escape(param) : "-" when ?t params[spec].strftime(param || CLF_TIME_FORMAT) when ?% "%" else escape(params[spec].to_s) end } end def escape(data) if data.tainted? data.gsub(/[[:cntrl:]\\]+/) {$&.dump[1...-1]}.untaint else data end end end end
Upload File
Create Folder