]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Prevent caching a partial XHR response as a full page URL
[rails.git] / app / assets / javascripts / index.js
index c3ee1e3bc9b47729faab64ad478d6a7818cbabb4..2cf45e9ad9920a4e11f8210d9bd15bd938857ac3 100644 (file)
@@ -38,6 +38,14 @@ $(document).ready(function () {
 
     $("#sidebar_loader").show().addClass("delayed-fade-in");
 
+    // Prevent caching the XHR response as a full-page URL
+    // https://github.com/openstreetmap/openstreetmap-website/issues/5663
+    if (content_path.indexOf("?") >= 0) {
+      content_path += "&xhr=1";
+    } else {
+      content_path += "?xhr=1";
+    }
+
     $("#sidebar_content")
       .empty();