Browse Source

Fix same hostname referrer

pull/2/head
Noah Petherbridge 5 years ago
parent
commit
d5291aeebd
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      rophako/model/tracking.py

+ 3
- 2
rophako/model/tracking.py View File

@@ -80,8 +80,9 @@ def log_referrer(request, link):
"""Double check the referring URL."""

# Ignore if same domain.
if link.startswith(request.url_root):
print "Referrer is same host!"
hostname = server_name()
if link.startswith("http://{}".format(hostname)) or \
link.startswith("https://{}".format(hostname)):
return None

# See if the URL really links back to us.

Loading…
Cancel
Save