]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/site_controller.rb
Fix security policy for mapillary in iD
[rails.git] / app / controllers / site_controller.rb
index 5ca5c0aabcdda8202fef65b8fd51b2ca015e604d..272f99109707bfc6830b9eeca3c1a0e5c628e35b 100644 (file)
@@ -92,8 +92,8 @@ class SiteController < ApplicationController
       @lat = note.lat
       @lon = note.lon
       @zoom = 17
-    elsif params[:gpx] && @user
-      trace = Trace.visible_to(@user).find(params[:gpx])
+    elsif params[:gpx] && current_user
+      trace = Trace.visible_to(current_user).find(params[:gpx])
       @lat = trace.latitude
       @lon = trace.longitude
       @zoom = 16
@@ -120,9 +120,9 @@ class SiteController < ApplicationController
 
   def id
     append_content_security_policy_directives(
-      :connect_src => %w[taginfo.openstreetmap.org *.mapillary.com],
-      :img_src => %w[*],
-      :script_src => %w[dev.virtualearth.net]
+      :connect_src => %w[nominatim.openstreetmap.org taginfo.openstreetmap.org *.mapillary.com d1cuyjsrcm0gby.cloudfront.net d1brzeo354iq2l.cloudfront.net openstreetcam.org],
+      :img_src => %w[* blob:],
+      :script_src => %w[dev.virtualearth.net 'unsafe-eval']
     )
 
     render "id", :layout => false