]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/site_controller.rb
Validate the assigned role, and remove the :type activrecord enum
[rails.git] / app / controllers / site_controller.rb
index 5ca5c0aabcdda8202fef65b8fd51b2ca015e604d..74dbc41f553c2a652661b762f68190dc1a92bc7c 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[*],
+      :img_src => %w[* blob:],
+      :script_src => %w[dev.virtualearth.net 'unsafe-eval']
     )
 
     render "id", :layout => false