diff options
author | Russ Smith <russ@bashme.org> | 2009-03-11 12:50:24 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-03-11 12:50:24 -0500 |
commit | f2c7508befb085ffe19ec7fb9ca2e6919cc919c9 (patch) | |
tree | 838b029ea24d6d9320082a5b0045d915c10ba1a6 /actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb | |
parent | 106976df0911e423042ec4abc165fd561766a047 (diff) | |
download | rails-f2c7508befb085ffe19ec7fb9ca2e6919cc919c9.tar.gz rails-f2c7508befb085ffe19ec7fb9ca2e6919cc919c9.tar.bz2 rails-f2c7508befb085ffe19ec7fb9ca2e6919cc919c9.zip |
Update bundled Rack to fix Litespeed compatibility [#2198 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb')
-rw-r--r-- | actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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 f352cb6783..e86d4ccdcd 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 @@ -144,6 +144,19 @@ module Rack end module_function :select_best_encoding + # Return the bytesize of String; uses String#length under Ruby 1.8 and + # String#bytesize under 1.9. + if ''.respond_to?(:bytesize) + def bytesize(string) + string.bytesize + end + else + def bytesize(string) + string.size + end + end + module_function :bytesize + # Context allows the use of a compatible middleware at different points # in a request handling stack. A compatible middleware must define # #context which should take the arguments env and app. The first of which |