rack-referral-tracking 0.0.3 → 0.0.4

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.
@@ -18,7 +18,7 @@ module Rack
18
18
  cookie_domain = '.' + host
19
19
 
20
20
  if referred_from_outside?(env)
21
- if env.has_key? 'REFERRAL_SECRET'
21
+ if ENV.has_key?('REFERRAL_SECRET')
22
22
  referer = Fernet.generate(ENV['REFERRAL_SECRET']) do |generator|
23
23
  generator.data = { :referrer => env["HTTP_REFERER"] }
24
24
  end
@@ -39,9 +39,9 @@ module Rack
39
39
 
40
40
  def referred_from_outside?(env)
41
41
  if env.has_key? 'HTTP_REFERER'
42
- refererer_domain = Domainatrix.parse(env['HTTP_REFERER']).domain_with_tld
43
- host = Domainatrix.parse(env["SERVER_NAME"]).domain_with_tld
44
- host != refererer_domain
42
+ referer_domain = Domainatrix.parse(env['HTTP_REFERER']).domain_with_tld
43
+ host = Domainatrix.parse(env["HTTP_HOST"]).domain_with_tld
44
+ host != referer_domain
45
45
  end
46
46
  end
47
47
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module ReferralTracking
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-referral-tracking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-22 00:00:00.000000000 Z
13
+ date: 2013-04-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: domainatrix