]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Send an appropriate Vary header when we negotiate the language to stop
[rails.git] / app / controllers / application_controller.rb
index d7debcb6d43ffb7e40c48e29f352fff930da9198..2093a959c85af202b2d4a4dfce420578f65489c9 100644 (file)
@@ -45,7 +45,6 @@ class ApplicationController < ActionController::Base
     # handle authenticate pass/fail
     unless @user
       # no auth, the user does not exist or the password was wrong
-      response.headers["Status"] = "Unauthorized" 
       response.headers["WWW-Authenticate"] = "Basic realm=\"#{realm}\"" 
       render :text => errormessage, :status => :unauthorized
       return false
@@ -102,9 +101,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