mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Unregister non-matching serviceworkers (#15834)
* Unregister non-matching serviceworkers With the addition of the /assets url, users who visited a previous version of the site now may have two active service workers, one with the old scope `/` and one with scope `/assets`. This check for serviceworkers that do not match the current script path and unregisters them. Also included is a small refactor to publicpath.js which was simplified because AssetUrlPrefix is always present now. Also it makes use of the new joinPaths helper too. Fixes: https://github.com/go-gitea/gitea/pull/15823
This commit is contained in:
@@ -789,6 +789,7 @@ var (
|
||||
"debug",
|
||||
"error",
|
||||
"explore",
|
||||
"favicon.ico",
|
||||
"ghost",
|
||||
"help",
|
||||
"install",
|
||||
@@ -807,10 +808,10 @@ var (
|
||||
"repo",
|
||||
"robots.txt",
|
||||
"search",
|
||||
"serviceworker.js",
|
||||
"stars",
|
||||
"template",
|
||||
"user",
|
||||
"favicon.ico",
|
||||
}
|
||||
|
||||
reservedUserPatterns = []string{"*.keys", "*.gpg"}
|
||||
|
Reference in New Issue
Block a user