]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
new translations
[rails.git] / app / controllers / application_controller.rb
index d9bc9e4f190bcf357193e626e93ce4116794604d..c43271b93a81faf5b3426a75097ac5fc1053f0e5 100644 (file)
@@ -143,9 +143,12 @@ class ApplicationController < ActionController::Base
   end
   
   def set_locale
+    response.header['Vary'] = 'Accept-Language'
+
     if @user
       if !@user.languages.empty?
         request.user_preferred_languages = @user.languages
+        response.header['Vary'] = '*'
       elsif !request.user_preferred_languages.empty?
         @user.languages = request.user_preferred_languages
         @user.save
@@ -171,6 +174,8 @@ class ApplicationController < ActionController::Base
     rescue OSM::APIError => ex
       report_error ex.message, ex.status
     rescue Exception => ex
+      logger.info("API threw unexpected #{ex.class} exception: #{ex.message}")
+      ex.backtrace.each { |l| logger.info(l) }
       report_error "#{ex.class}: #{ex.message}", :internal_server_error
     end
   end