From a5b784bdf7e093c76d0c09c56ae274c93c4cb956 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 8 Nov 2013 17:11:54 -0800 Subject: [PATCH] Replace Vary header with explicit xhr=1 param IE10 doesn't respect the Vary header. --- app/assets/javascripts/index.js | 4 ++-- app/assets/javascripts/index/export.js | 2 +- app/assets/javascripts/index/history.js | 2 +- app/controllers/application_controller.rb | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) 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 -- 2.39.5