Fix same hostname referrer
This commit is contained in:
parent
30b081cb86
commit
d5291aeebd
|
@ -80,8 +80,9 @@ def log_referrer(request, link):
|
||||||
"""Double check the referring URL."""
|
"""Double check the referring URL."""
|
||||||
|
|
||||||
# Ignore if same domain.
|
# Ignore if same domain.
|
||||||
if link.startswith(request.url_root):
|
hostname = server_name()
|
||||||
print "Referrer is same host!"
|
if link.startswith("http://{}".format(hostname)) or \
|
||||||
|
link.startswith("https://{}".format(hostname)):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# See if the URL really links back to us.
|
# See if the URL really links back to us.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user