diff --git a/data-browser/src/helpers/AppSettings.tsx b/data-browser/src/helpers/AppSettings.tsx index 152e00fa8..b61371f93 100644 --- a/data-browser/src/helpers/AppSettings.tsx +++ b/data-browser/src/helpers/AppSettings.tsx @@ -32,7 +32,8 @@ export const AppSettingsContextProvider = ( const [agent, setAgent] = useCurrentAgent(); const [baseURL, setBaseURL] = useServerURL(); - const [drive, innerSetDrive] = useLocalStorage('drive', baseURL); + // By default, we want to use the current URL's origin with a trailing slash. + const [drive, innerSetDrive] = useLocalStorage('drive', baseURL + '/'); function setDrive(newDrive: string) { const url = new URL(newDrive); diff --git a/data-browser/tests/e2e.spec.ts b/data-browser/tests/e2e.spec.ts index 2af80a89b..559811776 100644 --- a/data-browser/tests/e2e.spec.ts +++ b/data-browser/tests/e2e.spec.ts @@ -43,7 +43,7 @@ test.describe('data-browser', async () => { await page.goto(frontEndUrl); // Sometimes we run the test server on a different port, but we should // only change the drive if it is non-default. - if (serverUrl !== 'http://localhost:9883') { + if (serverUrl !== defaultDevServer) { await changeDrive(serverUrl, page); } await expect(page.locator(currentDriveTitle)).toBeVisible();