about summary refs log tree commit homepage
path: root/lib/clogger/pure.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-08-30 22:27:25 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-01 11:30:23 -0700
commita6e410b7f85f22e6adbc55eb9dd3a494ca7200b2 (patch)
treed92ed989d4bbb7a5764d2bd7d3c9aba69158b7d2 /lib/clogger/pure.rb
parenta6978053b9e9f4eff3e54bda6b4aa0c06f707075 (diff)
downloadclogger-a6e410b7f85f22e6adbc55eb9dd3a494ca7200b2.tar.gz
We're not Rack::Lint, but we still need to take steps to
avoid segfaulting if we host non-Rack::Lint-compliant
applications.

This also updates the pure variant to fail on bad applications,
too.
Diffstat (limited to 'lib/clogger/pure.rb')
-rw-r--r--lib/clogger/pure.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/clogger/pure.rb b/lib/clogger/pure.rb
index f593af0..0a7aa24 100644
--- a/lib/clogger/pure.rb
+++ b/lib/clogger/pure.rb
@@ -133,7 +133,12 @@ private
   end
 
   def get_sent_header(headers, match)
-    headers.each { |key, value| match == key.downcase and return value }
+    headers.each do |pair|
+      Array === pair && pair.size >= 2 or
+        raise TypeError, "headers not returning pairs"
+      key, value = pair
+      match == key.downcase and return value
+    end
     "-"
   end