geo_redirect 0.5 → 0.5.1
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 +4 -4
- data/README.md +1 -1
- data/lib/geo_redirect/middleware.rb +2 -0
- data/lib/geo_redirect/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb805fe570535898e17ea6ce307d9678fca06592
|
|
4
|
+
data.tar.gz: f778479e3b46d3f14370918f92cbd609aa399b8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26a9a0e3ec64548126373b48582e968ee617eeebab97d509679cbbe5b0e1b536d2865d1d43167adc6ae18ad601e411f2de81dba508342830449f12ccdf641604
|
|
7
|
+
data.tar.gz: 3d3cb9208831106ff865db2cd66840eaef622d43869a2660bdcc8ce790520f5e6eb7c9fc3d97a7bd0b1e7f91f894d79c836e26972019d0d828c7171ea821804d
|
data/README.md
CHANGED
|
@@ -110,7 +110,7 @@ will match `www.myapp.com/exclude` but not `www.myapp.com/other/path/exclude`
|
|
|
110
110
|
|
|
111
111
|
The default paths for these files are:
|
|
112
112
|
|
|
113
|
-
1. `config/
|
|
113
|
+
1. `config/geo_redirect.yml`
|
|
114
114
|
2. `db/GeoIP.dat`
|
|
115
115
|
|
|
116
116
|
If that doesn't suit you, you can customize these when adding `GeoRedirect` to
|
|
@@ -39,6 +39,7 @@ module GeoRedirect
|
|
|
39
39
|
|
|
40
40
|
def session_exists?
|
|
41
41
|
host = @request.session['geo_redirect']
|
|
42
|
+
host = host.to_sym if host && host.respond_to?(:to_sym)
|
|
42
43
|
if host && @config[host].nil? # Invalid var, remove it
|
|
43
44
|
log 'Invalid session var, forgetting'
|
|
44
45
|
forget_host(host)
|
|
@@ -50,6 +51,7 @@ module GeoRedirect
|
|
|
50
51
|
|
|
51
52
|
def handle_session
|
|
52
53
|
host = @request.session['geo_redirect']
|
|
54
|
+
host = host.is_a?(Symbol) ? host : host.to_sym if host
|
|
53
55
|
log "Handling session var: #{host}"
|
|
54
56
|
redirect_request(host)
|
|
55
57
|
end
|
data/lib/geo_redirect/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: geo_redirect
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sagie Maoz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|