diff options
| author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-02-06 19:57:25 +1300 |
|---|---|---|
| committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-02-08 00:52:30 +1300 |
| commit | 48ab3cfb6f42e1b0781b9c57dc1a9c2a142f3dfc (patch) | |
| tree | e68a6c9830a26e62ed3d3d09d7c3562fd91aac8d | |
| parent | 290523f67cc43c5847b2be2d12964d1232061fe1 (diff) | |
| download | rack-48ab3cfb6f42e1b0781b9c57dc1a9c2a142f3dfc.tar.gz | |
Relax requirement as it breaks tests.
| -rw-r--r-- | lib/rack/lint.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb index 17e98ef7..5349034e 100644 --- a/lib/rack/lint.rb +++ b/lib/rack/lint.rb @@ -284,15 +284,13 @@ module Rack 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 |
