Project

General

Profile

Feature #1103 ยป fix_webrick.patch

tenderlovemaking (Aaron Patterson), 02/04/2009 12:58 PM

View differences:

lib/webrick/httpservlet/cgihandler.rb (working copy)
Ruby = File::join(RbConfig::CONFIG['bindir'],
RbConfig::CONFIG['ruby_install_name'])
Ruby << RbConfig::CONFIG['EXEEXT']
CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
CGIRunnerExec = "\"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
CGIRunner = "\"#{Ruby}\" #{CGIRunnerExec}"
def initialize(server, name)
super(server, name)
@script_filename = name
@tempdir = server[:TempDir]
@cgicmd = "#{CGIRunner} #{server[:CGIInterpreter]}"
cmd = server[:CGIRuby] ? "#{server[:CGIRuby]} #{CGIRunnerExec}" : CGIRunner
@cgicmd = "#{cmd} #{server[:CGIInterpreter]}"
end
def do_GET(req, res)
test/webrick/test_cgi.rb (working copy)
def start_cgi_server(&block)
config = {
:CGIInterpreter => TestWEBrick::RubyBin,
:CGIRuby => TestWEBrick::RubyBin,
:DocumentRoot => File.dirname(__FILE__),
:DirectoryIndex => ["webrick.cgi"],
:RequestHandler => Proc.new{|req, res|
test/webrick/test_filehandler.rb (working copy)
def test_script_disclosure
config = {
:CGIInterpreter => TestWEBrick::RubyBin,
:CGIRuby => TestWEBrick::RubyBin,
:DocumentRoot => File.dirname(__FILE__),
:CGIPathEnv => ENV['PATH'],
}
    (1-1/1)