diff --git a/SPEC.rdoc b/SPEC.rdoc
index 6c6b95b8a..4cb02d744 100644
--- a/SPEC.rdoc
+++ b/SPEC.rdoc
@@ -246,8 +246,8 @@ if the request env has rack.hijack? true.
request pattern is intended to provide the hijacker with "raw tcp".
== The Response
=== The Status
-This is an HTTP status. When parsed as integer (+to_i+), it must be
-greater than or equal to 100.
+This is an HTTP status. It must be an Integer 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.
diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb
index 67493af45..67264771d 100755
--- a/lib/rack/lint.rb
+++ b/lib/rack/lint.rb
@@ -659,9 +659,11 @@ def check_hijack_response(headers, env)
## === The Status
def check_status(status)
- ## This is an HTTP status. When parsed as integer (+to_i+), it must be
- ## greater than or equal to 100.
- assert("Status must be >=100 seen as integer") { status.to_i >= 100 }
+ ## This is an HTTP status. It must be an Integer greater than or equal to
+ ## 100.
+ assert("Status must be an Integer >=100") {
+ status.is_a?(Integer) && status >= 100
+ }
end
## === The Headers
diff --git a/test/spec_content_type.rb b/test/spec_content_type.rb
index 4cfc32231..a11d2c9d3 100644
--- a/test/spec_content_type.rb
+++ b/test/spec_content_type.rb
@@ -44,12 +44,4 @@ def request
response[1]['Content-Type'].must_be_nil
end
end
-
- ['100', '204', '304'].each do |code|
- it "not set Content-Type on #{code} responses if status is a string" do
- app = lambda { |env| [code, {}, []] }
- response = content_type(app, "text/html").call(request)
- response[1]['Content-Type'].must_be_nil
- end
- end
end
diff --git a/test/spec_lint.rb b/test/spec_lint.rb
index f7da81c33..3847116b1 100755
--- a/test/spec_lint.rb
+++ b/test/spec_lint.rb
@@ -266,14 +266,21 @@ def result.name
["cc", {}, ""]
}).call(env({}))
}.must_raise(Rack::Lint::LintError).
- message.must_match(/must be >=100 seen as integer/)
+ message.must_match(/must be an Integer >=100/)
lambda {
Rack::Lint.new(lambda { |env|
[42, {}, ""]
}).call(env({}))
}.must_raise(Rack::Lint::LintError).
- message.must_match(/must be >=100 seen as integer/)
+ message.must_match(/must be an Integer >=100/)
+
+ lambda {
+ Rack::Lint.new(lambda { |env|
+ ["200", {}, ""]
+ }).call(env({}))
+ }.must_raise(Rack::Lint::LintError).
+ message.must_match(/must be an Integer >=100/)
end
it "notice header errors" do