From bdc5e01bc7faea1a9dbdb3a3de1b7b4438419bb1 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Tue, 20 Feb 2024 13:03:29 +0100 Subject: [PATCH] Remove htaccess for serviceWorker.js Adding the header `Service-Worker-Allowed: /` throw the php script --- com.woltlab.wcf/templates/headIncludeJavaScript.tpl | 2 +- wcfsetup/install/files/js/.htaccess | 5 ----- .../files/{js/serviceWorker.js => service-worker/index.php} | 4 ++++ 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 wcfsetup/install/files/js/.htaccess rename wcfsetup/install/files/{js/serviceWorker.js => service-worker/index.php} (96%) diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index b51fbc7b30..6f0ee4bb03 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -78,7 +78,7 @@ window.addEventListener('pageshow', function(event) { {if $__wcf->user->userID && SERVICE_WORKER_PUBLIC_KEY !== ''} serviceWorker: { publicKey: '{@SERVICE_WORKER_PUBLIC_KEY|encodeJS}', - serviceWorkerJsUrl: '{$__wcf->getPath('wcf')}js/serviceWorker.js', + serviceWorkerJsUrl: '{$__wcf->getPath('wcf')}js/service-worker/', registerUrl: '{link controller="RegisterServiceWorker"}{/link}', }, {/if} diff --git a/wcfsetup/install/files/js/.htaccess b/wcfsetup/install/files/js/.htaccess deleted file mode 100644 index 36f874da9d..0000000000 --- a/wcfsetup/install/files/js/.htaccess +++ /dev/null @@ -1,5 +0,0 @@ - - - Header set Service-Worker-Allowed: / - - diff --git a/wcfsetup/install/files/js/serviceWorker.js b/wcfsetup/install/files/service-worker/index.php similarity index 96% rename from wcfsetup/install/files/js/serviceWorker.js rename to wcfsetup/install/files/service-worker/index.php index 38997153d8..01c6491160 100644 --- a/wcfsetup/install/files/js/serviceWorker.js +++ b/wcfsetup/install/files/service-worker/index.php @@ -1,3 +1,7 @@ + /** * @author Olaf Braun * @copyright 2001-2024 WoltLab GmbH -- 2.20.1