aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-02-07 16:18:09 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-07 16:18:09 -0600
commit524d8edf68ab94315a128cbd7570d1cf4faf7d7a (patch)
tree9216f1a68194be1bc27a9e83de40205e1c419f4e /actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb
parent0edb0a4facdf6de8d12a004b59232e1006b93cd9 (diff)
downloadrails-524d8edf68ab94315a128cbd7570d1cf4faf7d7a.tar.gz
rails-524d8edf68ab94315a128cbd7570d1cf4faf7d7a.tar.bz2
rails-524d8edf68ab94315a128cbd7570d1cf4faf7d7a.zip
Update bundled Rack for Ruby 1.9 spec changes
Diffstat (limited to 'actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb')
-rw-r--r--actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb17
1 files changed, 7 insertions, 10 deletions
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 c8c4f674e6..53e54955b7 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
@@ -338,16 +338,13 @@ module Rack
## but only contain keys that consist of
## letters, digits, <tt>_</tt> or <tt>-</tt> and start with a letter.
assert("invalid header name: #{key}") { key =~ /\A[a-zA-Z][a-zA-Z0-9_-]*\z/ }
- ##
- ## The values of the header must respond to #each.
- assert("header values must respond to #each, but the value of " +
- "'#{key}' doesn't (is #{value.class})") { value.respond_to? :each }
- value.each { |item|
- ## The values passed on #each must be Strings
- assert("header values must consist of Strings, but '#{key}' also contains a #{item.class}") {
- item.instance_of?(String)
- }
- ## and not contain characters below 037.
+
+ ## The values of the header must be Strings,
+ assert("a header value must be a String, but the value of " +
+ "'#{key}' is a #{value.class}") { value.kind_of? String }
+ ## consisting of lines (for multiple header values) seperated by "\n".
+ value.split("\n").each { |item|
+ ## The lines must not contain characters below 037.
assert("invalid header value #{key}: #{item.inspect}") {
item !~ /[\000-\037]/
}