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)
20 20
      Ruby = File::join(RbConfig::CONFIG['bindir'],
21 21
                        RbConfig::CONFIG['ruby_install_name'])
22 22
      Ruby << RbConfig::CONFIG['EXEEXT']
23
      CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
24 23

  
24
      CGIRunnerExec = "\"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
25
      CGIRunner = "\"#{Ruby}\" #{CGIRunnerExec}"
26

  
25 27
      def initialize(server, name)
26 28
        super(server, name)
27 29
        @script_filename = name
28 30
        @tempdir = server[:TempDir]
29
        @cgicmd = "#{CGIRunner} #{server[:CGIInterpreter]}"
31
        cmd = server[:CGIRuby] ? "#{server[:CGIRuby]} #{CGIRunnerExec}" : CGIRunner
32
        @cgicmd = "#{cmd} #{server[:CGIInterpreter]}"
30 33
      end
31 34

  
32 35
      def do_GET(req, res)
test/webrick/test_cgi.rb (working copy)
8 8
  def start_cgi_server(&block)
9 9
    config = {
10 10
      :CGIInterpreter => TestWEBrick::RubyBin,
11
      :CGIRuby => TestWEBrick::RubyBin,
11 12
      :DocumentRoot => File.dirname(__FILE__),
12 13
      :DirectoryIndex => ["webrick.cgi"],
13 14
      :RequestHandler => Proc.new{|req, res|
test/webrick/test_filehandler.rb (working copy)
173 173
  def test_script_disclosure
174 174
    config = {
175 175
      :CGIInterpreter => TestWEBrick::RubyBin,
176
      :CGIRuby => TestWEBrick::RubyBin,
176 177
      :DocumentRoot => File.dirname(__FILE__),
177 178
      :CGIPathEnv => ENV['PATH'],
178 179
    }