From 9f2e7c1bd0b5cdc59dcccff4b57b6784bb29dba2 Mon Sep 17 00:00:00 2001 From: Lovekesh Kumar Date: Tue, 15 Feb 2022 15:37:00 +0530 Subject: [PATCH] Update: Make fetch request to location.href instead of base origin Making fetch requests to the base origin i.e. fetch('.') will drop the query params. Co-authored-by: Weston Ruter --- wp-includes/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/template.php b/wp-includes/template.php index 22bf4ee63..2ea6b08f9 100644 --- a/wp-includes/template.php +++ b/wp-includes/template.php @@ -200,7 +200,7 @@ function wp_service_worker_offline_page_reload() { */ async function checkNetworkAndReload() { try { - const response = await fetch('.', {method: 'HEAD'}); + const response = await fetch(location.href, {method: 'HEAD'}); // Verify we get a valid response from the server if (response.status >= 200 && response.status < 500) { window.location.reload();