]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Add support for Content-Security-Policy
[rails.git] / app / controllers / application_controller.rb
index 8eb5f240906579f6fdb21fff01a293fc8c0483ea..10901fdd5f4236cc015ff31b6ab33645b9f8099e 100644 (file)
@@ -407,6 +407,11 @@ class ApplicationController < ActionController::Base
   end
 
   def map_layout
+    append_content_security_policy_directives(
+      :connect_src => %w(nominatim.openstreetmap.org overpass-api.de router.project-osrm.org valhalla.mapzen.com),
+      :script_src => %w(graphhopper.com open.mapquestapi.com)
+    )
+
     request.xhr? ? "xhr" : "map"
   end