actionpack-cloudfront 1.0.2 → 1.0.3
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 +5 -5
- data/CHANGELOG.md +7 -0
- data/lib/action_pack/cloudfront.rb +1 -0
- data/lib/action_pack/cloudfront/ip-ranges.json +7902 -3032
- data/lib/action_pack/cloudfront/location_headers.rb +23 -0
- data/lib/action_pack/cloudfront/railtie.rb +4 -0
- data/lib/action_pack/cloudfront/version.rb +1 -1
- metadata +4 -3
@@ -0,0 +1,23 @@
|
|
1
|
+
module ActionPack
|
2
|
+
module Cloudfront
|
3
|
+
module LocationHeaders
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
EU_ISO_3166_ALPHA_2 = /^(AL|AD|AT|BY|BE|BA|BG|HR|CY|CZ|DK|EE|FI
|
7
|
+
|FR|DE|GI|GR|HU|IS|IE|IM|IT|RS|LV|LI|LT
|
8
|
+
|LU|MK|MT|MD|MC|ME|NL|NO|PL|PT|RO|RU|SM
|
9
|
+
|RS|SK|SI|ES|SE|CH|UA|GB|VA|RS)$/ix
|
10
|
+
|
11
|
+
included do
|
12
|
+
helper_method :request_eu?
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def request_eu?
|
18
|
+
country_code = request.headers['CloudFront-Viewer-Country']
|
19
|
+
!(country_code =~ EU_ISO_3166_ALPHA_2).nil?
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack-cloudfront
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/action_pack/cloudfront.rb
|
109
109
|
- lib/action_pack/cloudfront/ip-ranges.json
|
110
110
|
- lib/action_pack/cloudfront/ip_ranges.rb
|
111
|
+
- lib/action_pack/cloudfront/location_headers.rb
|
111
112
|
- lib/action_pack/cloudfront/railtie.rb
|
112
113
|
- lib/action_pack/cloudfront/version.rb
|
113
114
|
- lib/actionpack-cloudfront.rb
|
@@ -131,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
132
|
version: '0'
|
132
133
|
requirements: []
|
133
134
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.6.
|
135
|
+
rubygems_version: 2.7.6.2
|
135
136
|
signing_key:
|
136
137
|
specification_version: 4
|
137
138
|
summary: Configure ActionDispatch::RemoteIp trusted proxies for Amazon CloudFront.
|