]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/export.erb
Add support for referer blocks in tile server export script
[chef.git] / cookbooks / tile / templates / default / export.erb
index dfd076252167166384bc5c1397ba3b08200b18c3..b9f389626699c91c7947c96b0427e17d6c8ccb5c 100644 (file)
@@ -71,6 +71,11 @@ elif os.environ['HTTP_USER_AGENT'] == '<%= user_agent %>':
   # Block scraper
   output_error("The server is too busy at the moment. Please wait a few minutes before trying again.", "503 Service Unavailable")
 <% end -%>
+<% @blocks["referers"].each do |referer| -%>
+elif os.environ['HTTP_REFERER'] == '<%= referer %>':
+  # Block scraper
+  output_error("The server is too busy at the moment. Please wait a few minutes before trying again.", "503 Service Unavailable")
+<% end -%>
 elif not form.has_key("bbox"):
   # No bounding box specified
   output_error("No bounding box specified")