Remove spurious AppSubUrl in serviceworker request.#16047
Conversation
There is another spurious AppSubUrl placement in the serviceworker registration. This PR removes it. Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
| @@ -44,7 +44,7 @@ export default async function initServiceWorker() { | |||
| // normally we'd serve the service worker as a static asset from AssetUrlPrefix but | |||
| // the spec strictly requires it to be same-origin so it has to be AppSubUrl to work | |||
There was a problem hiding this comment.
This comment no longer matches the code, it needs to be updated
|
Are you sure it's removable? Does it still work with the app on a subdirectory? |
|
I wonder why we actually put it on |
|
I run gitea on a subdirectory as my testing platform so that's why I spot these. Removing this makes this correct for me. I don't run with a static URL prefix so I don't know what those URLs should look like - but I doubt that they should have AppSuburl either. It may be helpful to add comments to the static URL prefix go "constant" similar to those I added to AppURL and AppSuburl which state whether or not they have preceding or suffixed '/'s - this has saved me multiple times as I every time I use one (at least in go) vscode tells me whether I need to add a / or not. |
|
Regarding slashes, we should just ensure the backend variables never contain a trailing slash (e.g. stripping it from config var), that way we can remove the |
Signed-off-by: Andrew Thornton <art27@cantab.net>
There is another spurious AppSubUrl placement in the serviceworker registration. This PR removes it. Signed-off-by: Andrew Thornton <art27@cantab.net>
There is another spurious AppSubUrl placement in the serviceworker registration.
This PR removes it.
Signed-off-by: Andrew Thornton art27@cantab.net