From: John Firebaugh Date: Sat, 9 Nov 2013 01:11:54 +0000 (-0800) Subject: Replace Vary header with explicit xhr=1 param X-Git-Tag: live~5234^2~130 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a5b784bdf7e093c76d0c09c56ae274c93c4cb956 Replace Vary header with explicit xhr=1 param IE10 doesn't respect the Vary header. --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index f982ff1e1..5e96c3517 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -235,7 +235,7 @@ $(document).ready(function () { page.pushstate = page.popstate = function(path) { $("#content").addClass("overlay-sidebar"); map.invalidateSize(); - $('#sidebar_content').load(path, function(a, b, xhr) { + $('#sidebar_content').load(path + "?xhr=1", function(a, b, xhr) { if (xhr.getResponseHeader('X-Page-Title')) { document.title = xhr.getResponseHeader('X-Page-Title'); } @@ -254,7 +254,7 @@ $(document).ready(function () { var page = {}; page.pushstate = page.popstate = function(path, type, id) { - $('#sidebar_content').load(path, function(a, b, xhr) { + $('#sidebar_content').load(path + "?xhr=1", function(a, b, xhr) { if (xhr.getResponseHeader('X-Page-Title')) { document.title = xhr.getResponseHeader('X-Page-Title'); } diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js index 4842fff0c..a2d6c4f07 100644 --- a/app/assets/javascripts/index/export.js +++ b/app/assets/javascripts/index/export.js @@ -51,7 +51,7 @@ OSM.Export = function(map) { page.pushstate = page.popstate = function(path) { $("#export_tab").addClass("current"); - $("#sidebar_content").load(path, function(a, b, xhr) { + $("#sidebar_content").load(path + "?xhr=1", function(a, b, xhr) { if (xhr.getResponseHeader('X-Page-Title')) { document.title = xhr.getResponseHeader('X-Page-Title'); } diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index 6cbc86307..29a3d1fb9 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -99,7 +99,7 @@ OSM.History = function(map) { page.pushstate = page.popstate = function(path) { $("#history_tab").addClass("current"); - $("#sidebar_content").load(path, function(a, b, xhr) { + $("#sidebar_content").load(path + "?xhr=1", function(a, b, xhr) { if (xhr.getResponseHeader('X-Page-Title')) { document.title = xhr.getResponseHeader('X-Page-Title'); } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9c6ea3b33..97ab5abfc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -423,7 +423,6 @@ class ApplicationController < ActionController::Base end def map_layout - response.headers['Vary'] = 'X-Requested-With' request.xhr? ? false : 'map' end