]> git.openstreetmap.org Git - chef.git/commitdiff
Cope with no referer
authorTom Hughes <tom@compton.nu>
Wed, 30 Nov 2016 01:19:19 +0000 (01:19 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 30 Nov 2016 01:19:19 +0000 (01:19 +0000)
cookbooks/tile/templates/default/export.erb

index b9f389626699c91c7947c96b0427e17d6c8ccb5c..c05083835b43b28a65564001dd97957c39dfe071 100644 (file)
@@ -58,6 +58,10 @@ form = cgi.FieldStorage()
 if not os.environ.has_key('HTTP_USER_AGENT'):
   os.environ['HTTP_USER_AGENT'] = 'NONE'
 
+# Make sure we have a referer
+if not os.environ.has_key('HTTP_REFERER'):
+  os.environ['HTTP_REFERER'] = 'NONE'
+
 # Get the load average
 cputimes = [float(n) for n in open("/proc/stat").readline().rstrip().split()[1:-1]]
 idletime = cputimes[3] / sum(cputimes)