~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/webrick/httpservlet/cgihandler.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2006-05-08 22:23:12 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060508222312-w2wqeaz030ifi59j
Tags: 1.9.0+20060423-3ubuntu1
* Resynchronized with Debian.
* Only change from Debian is the addition of
  debian/patches/903_sparc_fix_define.patch to fix illegal instructions
  at runtime on sparc. (change from 1.9.0+20050921-1ubuntu1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
  module HTTPServlet
18
18
 
19
19
    class CGIHandler < AbstractServlet
20
 
      Ruby = File::join(::Config::CONFIG['bindir'],
21
 
                        ::Config::CONFIG['ruby_install_name'])
22
 
      Ruby << ::Config::CONFIG['EXEEXT']
23
 
      CGIRunner = "\"#{Ruby}\" \"#{Config::LIBDIR}/httpservlet/cgi_runner.rb\""
 
20
      Ruby = File::join(RbConfig::CONFIG['bindir'],
 
21
                        RbConfig::CONFIG['ruby_install_name'])
 
22
      Ruby << RbConfig::CONFIG['EXEEXT']
 
23
      CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
24
24
 
25
25
      def initialize(server, name)
26
26
        super(server, name)
85
85
            res.status = $1.to_i
86
86
            header.delete('status')
87
87
          end
 
88
          if header.has_key?('set-cookie')
 
89
            header['set-cookie'].each{|k|
 
90
              res.cookies << Cookie.parse_set_cookie(k)
 
91
            }
 
92
            header.delete('set-cookie')
 
93
          end
88
94
          header.each{|key, val| res[key] = val.join(", ") }
89
95
        rescue => ex
90
96
          raise HTTPStatus::InternalServerError, ex.message