diff --git a/CHANGELOG.md b/CHANGELOG.md index b8f0874..8bf0605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ See this http://keepachangelog.com link for information on how we want this documented formatted. +## Unreleased + +#### Removed + +- Remove `request_eu?` helper method + ## v1.2.0 #### Changed diff --git a/lib/action_pack/cloudfront.rb b/lib/action_pack/cloudfront.rb index 5221d16..fa72093 100644 --- a/lib/action_pack/cloudfront.rb +++ b/lib/action_pack/cloudfront.rb @@ -5,7 +5,6 @@ require 'net/http' require 'action_pack/cloudfront/version' require 'action_pack/cloudfront/ip_ranges' -require 'action_pack/cloudfront/location_headers' require 'action_pack/cloudfront/railtie' module ActionPack diff --git a/lib/action_pack/cloudfront/location_headers.rb b/lib/action_pack/cloudfront/location_headers.rb deleted file mode 100644 index 177aa40..0000000 --- a/lib/action_pack/cloudfront/location_headers.rb +++ /dev/null @@ -1,23 +0,0 @@ -module ActionPack - module Cloudfront - module LocationHeaders - extend ActiveSupport::Concern - - EU_ISO_3166_ALPHA_2 = /^(AL|AD|AT|BY|BE|BA|BG|HR|CY|CZ|DK|EE|FI - |FR|DE|GI|GR|HU|IS|IE|IM|IT|RS|LV|LI|LT - |LU|MK|MT|MD|MC|ME|NL|NO|PL|PT|RO|RU|SM - |RS|SK|SI|ES|SE|CH|UA|GB|VA|RS)$/ix - - included do - helper_method :request_eu? - end - - private - - def request_eu? - country_code = request.headers['CloudFront-Viewer-Country'] - !(country_code =~ EU_ISO_3166_ALPHA_2).nil? - end - end - end -end diff --git a/lib/action_pack/cloudfront/railtie.rb b/lib/action_pack/cloudfront/railtie.rb index bba276b..53afe20 100644 --- a/lib/action_pack/cloudfront/railtie.rb +++ b/lib/action_pack/cloudfront/railtie.rb @@ -16,10 +16,6 @@ class Railtie < ::Rails::Railtie end end - config.to_prepare do - ::ApplicationController.send :include, ActionPack::Cloudfront::LocationHeaders - end - end end end