diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-02-10 13:18:13 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-02-10 13:18:13 -0600 |
commit | 5689e681e9ec5824de6bc2b667b5bee3920bf91f (patch) | |
tree | e9ead37e53d83fa971a731ab72c17e1d84f7c123 /actionpack/lib/action_controller/vendor | |
parent | f400209084fabb00e18c3325e1933f4543fce94c (diff) | |
download | rails-5689e681e9ec5824de6bc2b667b5bee3920bf91f.tar.gz rails-5689e681e9ec5824de6bc2b667b5bee3920bf91f.tar.bz2 rails-5689e681e9ec5824de6bc2b667b5bee3920bf91f.zip |
Update vendored rack
Diffstat (limited to 'actionpack/lib/action_controller/vendor')
5 files changed, 32 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/vendor/rack-1.0/rack.rb b/actionpack/lib/action_controller/vendor/rack-1.0/rack.rb index d2e36b1333..c64bfe4f4d 100644 --- a/actionpack/lib/action_controller/vendor/rack-1.0/rack.rb +++ b/actionpack/lib/action_controller/vendor/rack-1.0/rack.rb @@ -3,7 +3,8 @@ # Rack is freely distributable under the terms of an MIT-style license. # See COPYING or http://www.opensource.org/licenses/mit-license.php. -$:.unshift(File.expand_path(File.dirname(__FILE__))) +$: << File.expand_path(File.dirname(__FILE__)) + # The Rack main module, serving as a namespace for all core Rack # modules and classes. diff --git a/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb b/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb index b213eac6f4..8489c9b9c4 100644 --- a/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb +++ b/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb @@ -16,11 +16,20 @@ module Rack private def unauthorized(www_authenticate = challenge) - return [ 401, { 'WWW-Authenticate' => www_authenticate.to_s }, [] ] + return [ 401, + { 'Content-Type' => 'text/plain', + 'Content-Length' => '0', + 'WWW-Authenticate' => www_authenticate.to_s }, + [] + ] end def bad_request - [ 400, {}, [] ] + return [ 400, + { 'Content-Type' => 'text/plain', + 'Content-Length' => '0' }, + [] + ] end end diff --git a/actionpack/lib/action_controller/vendor/rack-1.0/rack/file.rb b/actionpack/lib/action_controller/vendor/rack-1.0/rack/file.rb index 44f76297b8..7869227a36 100644 --- a/actionpack/lib/action_controller/vendor/rack-1.0/rack/file.rb +++ b/actionpack/lib/action_controller/vendor/rack-1.0/rack/file.rb @@ -13,6 +13,8 @@ module Rack attr_accessor :root attr_accessor :path + alias :to_path :path + def initialize(root) @root = root end diff --git a/actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb b/actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb index 53e54955b7..7eb05437f0 100644 --- a/actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb +++ b/actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb @@ -442,6 +442,18 @@ module Rack ## If the Body responds to #close, it will be called after iteration. # XXX howto: assert("Body has not been closed") { @closed } + + ## + ## If the Body responds to #to_path, it must return a String + ## identifying the location of a file whose contents are identical + ## to that produced by calling #each. + + if @body.respond_to?(:to_path) + assert("The file identified by body.to_path does not exist") { + ::File.exist? @body.to_path + } + end + ## ## The Body commonly is an Array of Strings, the application ## instance itself, or a File-like object. diff --git a/actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb b/actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb index 5afeba7108..d13a5dfad0 100644 --- a/actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb +++ b/actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb @@ -50,12 +50,11 @@ module Rack return if k.empty? if after == "" - if cur = params[k] - if cur.is_a?(Array) - params[k] << v - else - params[k] = [cur, v] - end + cur = params[k] + if cur.is_a?(Array) + params[k] << v + elsif cur && name == $1 + params[k] = [cur, v] else params[k] = v end |