From: Tom Hughes Date: Sat, 15 Feb 2025 15:05:00 +0000 (+0000) Subject: Prevent caching a partial XHR response as a full page URL X-Git-Tag: live~133^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/b1397d9fc34ef0e7da061d94963d7610d1b9cf34?hp=-c Prevent caching a partial XHR response as a full page URL Fixes #5663 --- b1397d9fc34ef0e7da061d94963d7610d1b9cf34 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();