mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
applied patch by OHARA Shigeki:
* use Apache::Request#headers_in instead of obsolete #headers methods * XMLRPC::ModRubyServer::new is no longer a singleton method git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
885ea0a9f7
commit
777681bda1
1 changed files with 3 additions and 9 deletions
|
@ -509,22 +509,16 @@ Use it in the same way as CGIServer!
|
|||
=end
|
||||
|
||||
class ModRubyServer < BasicServer
|
||||
@@obj = nil
|
||||
|
||||
def ModRubyServer.new(*a)
|
||||
@@obj = super(*a) if @@obj.nil?
|
||||
@@obj
|
||||
end
|
||||
|
||||
def initialize(*a)
|
||||
@ap = Apache::request
|
||||
super(*a)
|
||||
end
|
||||
|
||||
|
||||
def serve
|
||||
catch(:exit_serve) {
|
||||
header = {}
|
||||
@ap.each_header {|key, value| header[key.capitalize] = value}
|
||||
@ap.headers_in.each {|key, value| header[key.capitalize] = value}
|
||||
|
||||
length = header['Content-length'].to_i
|
||||
|
||||
|
@ -569,7 +563,7 @@ class ModRubyServer < BasicServer
|
|||
h['Status'] ||= "200 OK"
|
||||
h['Content-length'] ||= body.size.to_s
|
||||
|
||||
h.each {|key, value| @ap[key] = value }
|
||||
h.each {|key, value| @ap.headers_out[key] = value }
|
||||
@ap.content_type = h["Content-type"]
|
||||
@ap.status = status.to_i
|
||||
@ap.send_http_header
|
||||
|
|
Loading…
Reference in a new issue