]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Update Potlatch 2 to 2.3-236-ge27f26d build
[rails.git] / app / controllers / application_controller.rb
index ea5d450a4e0b1cd665ee6e33c23f92b68cfc2207..0f9fad45e860ab40a6687b8eece4de1d59286cad 100644 (file)
@@ -51,7 +51,13 @@ class ApplicationController < ActionController::Base
   end
 
   def require_user
-    redirect_to :controller => 'user', :action => 'login', :referer => request.fullpath unless @user
+    unless @user
+      if request.get?
+        redirect_to :controller => 'user', :action => 'login', :referer => request.fullpath
+      else
+        render :nothing => true, :status => :forbidden
+      end
+    end
   end
 
   ##
@@ -334,7 +340,7 @@ class ApplicationController < ActionController::Base
     end)
 
     options[:cache_path] = Proc.new do |controller|
-      cache_path.merge(controller.params).merge(:locale => I18n.locale)
+      cache_path.merge(controller.params).merge(:host => SERVER_URL, :locale => I18n.locale)
     end
 
     actions.push(options)
@@ -346,7 +352,7 @@ class ApplicationController < ActionController::Base
   # extend expire_action to expire all variants
   def expire_action(options = {})
     I18n.available_locales.each do |locale|
-      super options.merge(:locale => locale)
+      super options.merge(:host => SERVER_URL, :locale => locale)
     end
   end