Skip to content

Commit

Permalink
Update: Make fetch request to location.href instead of base origin
Browse files Browse the repository at this point in the history
Making fetch requests to the base origin i.e. fetch('.') will drop the query params.

Co-authored-by: Weston Ruter <[email protected]>
  • Loading branch information
thelovekesh and westonruter authored Feb 15, 2022
1 parent 4245fa3 commit 9f2e7c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9f2e7c1

Please sign in to comment.