summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rack/lint.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb
index bc5b7f50..16b5feea 100644
--- a/lib/rack/lint.rb
+++ b/lib/rack/lint.rb
@@ -279,10 +279,10 @@ module Rack
assert("env missing required key #{header}") { env.include? header }
}
- ## The <tt>SERVER_PORT</tt> must be an integer if set.
- assert("env[SERVER_PORT] is not an integer") do
+ ## The <tt>SERVER_PORT</tt> must be an Integer if set.
+ assert("env[SERVER_PORT] is not an Integer") do
server_port = env["SERVER_PORT"]
- server_port.nil? || server_port.is_a?(Integer)
+ server_port.nil? || (Integer(server_port) rescue false)
end
## The <tt>SERVER_NAME</tt> must be a valid authority as defined by RFC7540.