From b1397d9fc34ef0e7da061d94963d7610d1b9cf34 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 15 Feb 2025 15:05:00 +0000 Subject: [PATCH] Prevent caching a partial XHR response as a full page URL Fixes #5663 --- app/assets/javascripts/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index c3ee1e3bc..2cf45e9ad 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -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(); -- 2.39.5