Skip to content

Commit

Permalink
Relax requirement as it breaks tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Feb 6, 2020
1 parent 63e15ee commit efede61
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/rack/lint.rb
Expand Up @@ -284,15 +284,13 @@ def check_env(env)
end

## The <tt>SERVER_NAME</tt> must be a valid authority as defined by RFC7540.
assert("env[SERVER_NAME] must be a valid host") do
server_name = env["SERVER_NAME"]
URI.parse("http://#{server_name}").host == server_name rescue false
assert("#{env[SERVER_NAME]} must be a valid authority") do
URI.parse("http://#{env[SERVER_NAME]}/") rescue false
end

## The <tt>HTTP_HOST</tt> must be a valid authority as defined by RFC7540.
assert("env[HTTP_HOST] must be a valid host") do
http_host = env["HTTP_HOST"]
URI.parse("http://#{http_host}/").host == http_host rescue false
assert("#{env[HTTP_HOST]} must be a valid authority") do
URI.parse("http://#{env[HTTP_HOST]}/") rescue false
end

## The environment must not contain the keys
Expand Down

0 comments on commit efede61

Please sign in to comment.