Skip to content
Permalink
Browse files

eliminate warning for testing of passing invalid header

  • Loading branch information
osamtimizer committed Dec 13, 2019
1 parent 72d8f46 commit 3d5491e3b9600b9a287061633b2216e0b10e8aac
Showing with 7 additions and 5 deletions.
  1. +1 −1 SPEC
  2. +6 −4 lib/rack/lint.rb
2 SPEC
@@ -225,9 +225,9 @@ This is an HTTP status. When parsed as integer (+to_i+), it must be
greater than or equal to 100.
=== The Headers
The header must respond to +each+, and yield values of key and value.
The header keys must be Strings.
Special headers starting "rack." are for communicating with the
server, and must not be sent back to the client.
The header keys must be Strings.
The header must not contain a +Status+ key.
The header must conform to RFC7230 token specification, i.e. cannot
contain non-printable ASCII, DQUOTE or "(),/:;<=>?@[\]{}".
@@ -627,15 +627,17 @@ def check_headers(header)
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

0 comments on commit 3d5491e

Please sign in to comment.
You can’t perform that action at this time.