]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Send appropriate Vary header
[rails.git] / app / controllers / application_controller.rb
index 12cdb15d4ebbc85c19bdcc353df7900044ec0427..9c6ea3b33beb9009680f75a1338d6b6724760170 100644 (file)
@@ -422,6 +422,11 @@ class ApplicationController < ActionController::Base
     request.body.rewind
   end
 
+  def map_layout
+    response.headers['Vary'] = 'X-Requested-With'
+    request.xhr? ? false : 'map'
+  end
+
   def preferred_editor
     editor = if params[:editor]
       params[:editor]