Skip to content
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

Fix ServiceWorker scope with BASE_PATH. #6935

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/shared/workers/serviceWorker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {BASE_PATH} from 'src/shared/constants'

export const registerServiceWorker = (): Promise<ServiceWorkerRegistration> => {
// Worker -- load prior to page load event, in order to intercept fetch in http/2.
// see service worker life cycle. https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
Expand All @@ -7,7 +9,7 @@ export const registerServiceWorker = (): Promise<ServiceWorkerRegistration> => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
new URL('../workers/downloadHelper.ts', import.meta.url),
{scope: '/api/v2/query'}
{scope: `${BASE_PATH}api/v2/query`}
/* webpackChunkName: "interceptor" */
)
}
Expand All @@ -25,7 +27,7 @@ export const registerServiceWorkerInfluxQL =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
new URL('../workers/downloadHelper.ts', import.meta.url),
{scope: '/query'}
{scope: `${BASE_PATH}query`}
/* webpackChunkName: "interceptor" */
)
}
Expand All @@ -43,7 +45,7 @@ export const registerServiceWorkerSQL =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
new URL('../workers/downloadHelper.ts', import.meta.url),
{scope: '/api/v2private/query'}
{scope: `${BASE_PATH}api/v2private/query`}
/* webpackChunkName: "interceptor" */
)
}
Expand Down