projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b5dff2
)
Cope with no referer
author
Tom Hughes
<tom@compton.nu>
Wed, 30 Nov 2016 01:19:19 +0000
(
01:19
+0000)
committer
Tom Hughes
<tom@compton.nu>
Wed, 30 Nov 2016 01:19:19 +0000
(
01:19
+0000)
cookbooks/tile/templates/default/export.erb
patch
|
blob
|
history
diff --git
a/cookbooks/tile/templates/default/export.erb
b/cookbooks/tile/templates/default/export.erb
index b9f389626699c91c7947c96b0427e17d6c8ccb5c..c05083835b43b28a65564001dd97957c39dfe071 100644
(file)
--- a/
cookbooks/tile/templates/default/export.erb
+++ b/
cookbooks/tile/templates/default/export.erb
@@
-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)