Skip to content

Commit e03a91a

Browse files
authored
Remove spurious AppSubUrl in serviceworker request. (#16047)
There is another spurious AppSubUrl placement in the serviceworker registration. This PR removes it. Signed-off-by: Andrew Thornton <[email protected]>
1 parent 44f8c81 commit e03a91a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

web_src/js/features/serviceworker.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {joinPaths} from '../utils.js';
22

3-
const {UseServiceWorker, AppSubUrl, AssetUrlPrefix, AppVer} = window.config;
3+
const {UseServiceWorker, AssetUrlPrefix, AppVer} = window.config;
44
const cachePrefix = 'static-cache-v'; // actual version is set in the service worker script
55
const workerAssetPath = joinPaths(AssetUrlPrefix, 'serviceworker.js');
66

@@ -41,10 +41,9 @@ export default async function initServiceWorker() {
4141
// unregister all service workers where scriptURL does not match the current one
4242
await unregisterOtherWorkers();
4343
try {
44-
// normally we'd serve the service worker as a static asset from AssetUrlPrefix but
45-
// the spec strictly requires it to be same-origin so it has to be AppSubUrl to work
44+
// the spec strictly requires it to be same-origin so the AssetUrlPrefix should contain AppSubUrl
4645
await checkCacheValidity();
47-
await navigator.serviceWorker.register(joinPaths(AppSubUrl, workerAssetPath));
46+
await navigator.serviceWorker.register(workerAssetPath);
4847
} catch (err) {
4948
console.error(err);
5049
await invalidateCache();

0 commit comments

Comments
 (0)