-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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>
web_src/js/features/serviceworker.js
Outdated
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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