app/soc/views/helper/requests.py
changeset 1381 2cfce3831fc6
parent 1373 178bd19966fe
child 1631 25ec972b5aa2
equal deleted inserted replaced
1380:e4235440897c 1381:2cfce3831fc6
   117 
   117 
   118   if not http_from:
   118   if not http_from:
   119     # no HTTP referrer, so cannot possibly start with expected prefix
   119     # no HTTP referrer, so cannot possibly start with expected prefix
   120     return False
   120     return False
   121 
   121 
   122   http_host = 'http://%s/%s' %(os.environ['HTTP_HOST'],url_name)
   122   http_host = 'http://%s/%s' %(os.environ['HTTP_HOST'], url_name)
   123 
   123 
   124   if http_from.startswith(http_host):
   124   if http_from.startswith(http_host):
   125     return True
   125     return True
   126 
   126 
   127   from_path = urlparse.urlparse(http_from).path
   127   from_path = urlparse.urlparse(http_from).path