rack-allowed_hosts 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e8a16d9cde4f0e3b7c9251ef74fad90b904c325
4
- data.tar.gz: 9818c819bea2a4615cbbfca7585c8624dc85c181
3
+ metadata.gz: 182f0a558b7a497fa56f1d57ef6b25b34c3b4bbf
4
+ data.tar.gz: e1fdd557500cdd58f3cb017253ddd4dec521d4ae
5
5
  SHA512:
6
- metadata.gz: 946e54aa8cc564612724ea61db8d72e46a63206a7a07190126cc20b4919ed1c975ed6e848dde71e12769234a1ec1dce5717ab2bbc6552cafe42197efb596fd41
7
- data.tar.gz: 24b5a2422bd9aad43f059152601f856dce14bc79a062c7be075c04905935cea2cdd7b0955588dae11dc40b159bf8fcbfd0325a5c55872ed478bba3aad01239c8
6
+ metadata.gz: 328ad815a7fd5fba7f50dd19505cbab6e98a84e3b6674a48594d1c0e5c5ac96852e0c499aef32472b465b981ab1d81568a5f6320c3b6f03b4193bf1d62bdd612
7
+ data.tar.gz: 2e82374299de498af935cd4362241892b060c73d8c275bbd240fdde248ca665239c23209e17550d373b5897771355579b37730b85348ebc1e6db779d16a648d4
@@ -27,9 +27,15 @@ module Rack
27
27
  end
28
28
 
29
29
  def call(env)
30
- host = env['HTTP_HOST'].split(':').first
31
- unless host_allowed?(host)
32
- return [403, {'Content-Type' => 'text/html'}, ['<h1>403 Forbidden</h1>']]
30
+ host_values = [
31
+ env['HTTP_HOST'].split(':').first,
32
+ env['SERVER_NAME']
33
+ ].uniq
34
+
35
+ host_values.each do |host|
36
+ unless host_allowed?(host)
37
+ return [403, {'Content-Type' => 'text/html'}, ['<h1>403 Forbidden</h1>']]
38
+ end
33
39
  end
34
40
 
35
41
  # Fetch the result
@@ -1,6 +1,6 @@
1
1
  module Rack
2
2
  class AllowedHosts
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-allowed_hosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Blalock