]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/site_controller.rb
Refactor notes#mine to simplify code
[rails.git] / app / controllers / site_controller.rb
index bfff50c6dc7f05a05a65248d0d95a611088116e2..471e9f3c5636d75d54765fc2854919e9a4da11e1 100644 (file)
@@ -12,7 +12,7 @@ class SiteController < ApplicationController
   authorize_resource :class => false
 
   def index
-    session[:location] ||= OSM.ip_location(request.env["REMOTE_ADDR"]) unless STATUS == :database_readonly || STATUS == :database_offline
+    session[:location] ||= OSM.ip_location(request.env["REMOTE_ADDR"]) unless Settings.status == "database_readonly" || Settings.status == "database_offline"
   end
 
   def permalink
@@ -70,6 +70,7 @@ class SiteController < ApplicationController
 
     if %w[potlatch potlatch2].include?(editor)
       append_content_security_policy_directives(
+        :connect_src => %w[*],
         :object_src => %w[*],
         :plugin_types => %w[application/x-shockwave-flash],
         :script_src => %w['unsafe-inline']
@@ -121,7 +122,7 @@ class SiteController < ApplicationController
     append_content_security_policy_directives(
       :connect_src => %w[*],
       :img_src => %w[* blob:],
-      :script_src => %w[dev.virtualearth.net *.wikipedia.org www.wikidata.org services.arcgisonline.com serviceslab.arcgisonline.com 'unsafe-eval'],
+      :script_src => %w[dev.virtualearth.net 'unsafe-eval'],
       :style_src => %w['unsafe-inline']
     )