summary refs log tree commit
path: root/lib/rack/lint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rack/lint.rb')
-rw-r--r--lib/rack/lint.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb
index 17b188f4..98ba9b44 100644
--- a/lib/rack/lint.rb
+++ b/lib/rack/lint.rb
@@ -627,15 +627,17 @@ module Rack
       assert("headers object should respond to #each, but doesn't (got #{header.class} as headers)") {
          header.respond_to? :each
       }
-      header.each { |key, value|
-        ## Special headers starting "rack." are for communicating with the
-        ## server, and must not be sent back to the client.
-        next if key =~ /^rack\..+$/
 
+      header.each { |key, value|
         ## The header keys must be Strings.
         assert("header key must be a string, was #{key.class}") {
           key.kind_of? String
         }
+
+        ## Special headers starting "rack." are for communicating with the
+        ## server, and must not be sent back to the client.
+        next if key =~ /^rack\..+$/
+
         ## The header must not contain a +Status+ key.
         assert("header must not contain Status") { key.downcase != "status" }
         ## The header must conform to RFC7230 token specification, i.e. cannot