glib-web 0.6.13 → 0.6.14
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c56cc5b0cb3eac25758cb566dcf2b69f10470a65df7fa00d25325db8958961d
|
|
4
|
+
data.tar.gz: 5d2d0bdef7274ec75442b5c8f6a2336463c51f73b07a40905ff5916168eaa349
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa471dad31b61bd7f6562627ece6574b56e68260d456c3f0b4a5f5b3e2ed344cccb6b682654ec286b1b4761a5bcdc51524cb96729dd8896fbc92adff0f141149
|
|
7
|
+
data.tar.gz: 281c3ceba5a2a22320ff553420d4c0a962e41123a35ebcf868127af880742c6e04cc6b2314413191d62b3cc9f0b71f08a9fd727ef2421f709f7209ea839f77ac
|
|
@@ -35,14 +35,20 @@ module Glib::Analytics
|
|
|
35
35
|
action = request.headers['GApp-Analytics-Referer-Action']
|
|
36
36
|
segment = request.headers['GApp-Analytics-Referer-Segment']
|
|
37
37
|
placement = request.headers['GApp-Analytics-Referer-Placement']
|
|
38
|
-
|
|
39
|
-
if group.nil? && action.nil? && !
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
referrer_url = request.headers['referer'] # Notice that the HTTP header uses one "r"
|
|
39
|
+
if group.nil? && action.nil? && !referrer_url.nil?
|
|
40
|
+
current_host = request.host
|
|
41
|
+
referrer_host = URI.parse(referrer_url).host
|
|
42
|
+
|
|
43
|
+
# Replace the subdomain portion with regex so it will only match the non-subdomain part.
|
|
44
|
+
# This will allow cross-subdomain referral, but it will not work if the host is a bare domain,
|
|
45
|
+
# which is something that we should avoid doing anyway.
|
|
46
|
+
regex = '^([^\.]*)\.'
|
|
47
|
+
if current_host == referrer_host || !/#{current_host.sub(/#{regex}/, regex)}/.match(referrer_host).nil?
|
|
48
|
+
referrer_url = referrer_url.delete_suffix('/')
|
|
43
49
|
|
|
44
50
|
begin
|
|
45
|
-
route = Rails.application.routes.recognize_path(
|
|
51
|
+
route = Rails.application.routes.recognize_path(referrer_url)
|
|
46
52
|
group = route[:controller]
|
|
47
53
|
action = route[:action]
|
|
48
54
|
rescue ActionController::RoutingError
|