Send an appropriate Vary header when we negotiate the language to stop
[rails.git] / app / controllers / application_controller.rb
index 0d6cdea6424fea77b93e32e047796546008a1637..2093a959c85af202b2d4a4dfce420578f65489c9 100644 (file)
@@ -101,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