Update Vendored Rack to 1.2.0
Also update tests for itextomml 1.3.25.
This commit is contained in:
parent
4f8759cdf3
commit
6491d70326
107 changed files with 1463 additions and 2008 deletions
18
vendor/plugins/rack/lib/rack/handler/cgi.rb
vendored
18
vendor/plugins/rack/lib/rack/handler/cgi.rb
vendored
|
@ -1,9 +1,11 @@
|
|||
require 'rack/content_length'
|
||||
require 'rack/rewindable_input'
|
||||
|
||||
module Rack
|
||||
module Handler
|
||||
class CGI
|
||||
def self.run(app, options=nil)
|
||||
$stdin.binmode
|
||||
serve app
|
||||
end
|
||||
|
||||
|
@ -15,8 +17,8 @@ module Rack
|
|||
|
||||
env["SCRIPT_NAME"] = "" if env["SCRIPT_NAME"] == "/"
|
||||
|
||||
env.update({"rack.version" => [1,1],
|
||||
"rack.input" => $stdin,
|
||||
env.update({"rack.version" => Rack::VERSION,
|
||||
"rack.input" => Rack::RewindableInput.new($stdin),
|
||||
"rack.errors" => $stderr,
|
||||
|
||||
"rack.multithread" => false,
|
||||
|
@ -40,20 +42,20 @@ module Rack
|
|||
end
|
||||
|
||||
def self.send_headers(status, headers)
|
||||
STDOUT.print "Status: #{status}\r\n"
|
||||
$stdout.print "Status: #{status}\r\n"
|
||||
headers.each { |k, vs|
|
||||
vs.split("\n").each { |v|
|
||||
STDOUT.print "#{k}: #{v}\r\n"
|
||||
$stdout.print "#{k}: #{v}\r\n"
|
||||
}
|
||||
}
|
||||
STDOUT.print "\r\n"
|
||||
STDOUT.flush
|
||||
$stdout.print "\r\n"
|
||||
$stdout.flush
|
||||
end
|
||||
|
||||
def self.send_body(body)
|
||||
body.each { |part|
|
||||
STDOUT.print part
|
||||
STDOUT.flush
|
||||
$stdout.print part
|
||||
$stdout.flush
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,7 +36,7 @@ module Rack
|
|||
|
||||
rack_input = RewindableInput.new(request.in)
|
||||
|
||||
env.update({"rack.version" => [1,1],
|
||||
env.update({"rack.version" => Rack::VERSION,
|
||||
"rack.input" => rack_input,
|
||||
"rack.errors" => request.err,
|
||||
|
||||
|
|
2
vendor/plugins/rack/lib/rack/handler/lsws.rb
vendored
2
vendor/plugins/rack/lib/rack/handler/lsws.rb
vendored
|
@ -20,7 +20,7 @@ module Rack
|
|||
rack_input = RewindableInput.new($stdin.read.to_s)
|
||||
|
||||
env.update(
|
||||
"rack.version" => [1,1],
|
||||
"rack.version" => Rack::VERSION,
|
||||
"rack.input" => rack_input,
|
||||
"rack.errors" => $stderr,
|
||||
"rack.multithread" => false,
|
||||
|
|
|
@ -52,7 +52,7 @@ module Rack
|
|||
rack_input = request.body || StringIO.new('')
|
||||
rack_input.set_encoding(Encoding::BINARY) if rack_input.respond_to?(:set_encoding)
|
||||
|
||||
env.update({"rack.version" => [1,1],
|
||||
env.update({"rack.version" => Rack::VERSION,
|
||||
"rack.input" => rack_input,
|
||||
"rack.errors" => $stderr,
|
||||
|
||||
|
|
5
vendor/plugins/rack/lib/rack/handler/scgi.rb
vendored
5
vendor/plugins/rack/lib/rack/handler/scgi.rb
vendored
|
@ -17,9 +17,6 @@ module Rack
|
|||
|
||||
def initialize(settings = {})
|
||||
@app = Rack::Chunked.new(Rack::ContentLength.new(settings[:app]))
|
||||
@log = Object.new
|
||||
def @log.info(*args); end
|
||||
def @log.error(*args); end
|
||||
super(settings)
|
||||
end
|
||||
|
||||
|
@ -36,7 +33,7 @@ module Rack
|
|||
rack_input = StringIO.new(input_body)
|
||||
rack_input.set_encoding(Encoding::BINARY) if rack_input.respond_to?(:set_encoding)
|
||||
|
||||
env.update({"rack.version" => [1,1],
|
||||
env.update({"rack.version" => Rack::VERSION,
|
||||
"rack.input" => rack_input,
|
||||
"rack.errors" => $stderr,
|
||||
"rack.multithread" => true,
|
||||
|
|
17
vendor/plugins/rack/lib/rack/handler/webrick.rb
vendored
17
vendor/plugins/rack/lib/rack/handler/webrick.rb
vendored
|
@ -7,12 +7,15 @@ module Rack
|
|||
class WEBrick < ::WEBrick::HTTPServlet::AbstractServlet
|
||||
def self.run(app, options={})
|
||||
options[:BindAddress] = options.delete(:Host) if options[:Host]
|
||||
server = ::WEBrick::HTTPServer.new(options)
|
||||
server.mount "/", Rack::Handler::WEBrick, app
|
||||
trap(:INT) { server.shutdown }
|
||||
trap(:TERM) { server.shutdown }
|
||||
yield server if block_given?
|
||||
server.start
|
||||
@server = ::WEBrick::HTTPServer.new(options)
|
||||
@server.mount "/", Rack::Handler::WEBrick, app
|
||||
yield @server if block_given?
|
||||
@server.start
|
||||
end
|
||||
|
||||
def self.shutdown
|
||||
@server.shutdown
|
||||
@server = nil
|
||||
end
|
||||
|
||||
def initialize(server, app)
|
||||
|
@ -27,7 +30,7 @@ module Rack
|
|||
rack_input = StringIO.new(req.body.to_s)
|
||||
rack_input.set_encoding(Encoding::BINARY) if rack_input.respond_to?(:set_encoding)
|
||||
|
||||
env.update({"rack.version" => [1,1],
|
||||
env.update({"rack.version" => Rack::VERSION,
|
||||
"rack.input" => rack_input,
|
||||
"rack.errors" => $stderr,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue