Skip to content
Snippets Groups Projects
Commit 2103cc27 authored by Xiao Gui's avatar Xiao Gui
Browse files

fix trailing slash issue

parent 38bfb6ed
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ env:
DOCKER_CONTAINER_NAME: gha-iav-built-${{ github.sha }}
DOCKER_E2E_PPTR: gha-iav-e2e-pptr-${{ github.sha }}
DOCKER_E2E_NETWORK: gha-dkr-network-${{ github.sha }}
ATLAS_URL: http://gha-iav-built-${{ github.sha }}:3000
ATLAS_URL: http://gha-iav-built-${{ github.sha }}:3000/
jobs:
buildimage:
......@@ -38,7 +38,6 @@ jobs:
docker run \
--rm \
--name ${DOCKER_CONTAINER_NAME} \
-p 13000:3000 \
--env HBP_CLIENTID=${{ secrets.HBP_CLIENTID }} \
--env HBP_CLIENTSECRET=${{ secrets.HBP_CLIENTSECRET }} \
--env REFRESH_TOKEN=${{ secrets.REFRESH_TOKEN }} \
......
......@@ -13,7 +13,7 @@ describe('protractor works', () => {
})
const pptr = require('puppeteer')
const ATLAS_URL = process.env.ATLAS_URL || 'http://localhost:3000'
const ATLAS_URL = (process.env.ATLAS_URL || 'http://localhost:3000').replace(/\/$/, '')
if (ATLAS_URL.length === 0) throw new Error(`ATLAS_URL must either be left unset or defined.`)
if (ATLAS_URL[ATLAS_URL.length - 1] === '/') throw new Error(`ATLAS_URL should not trail with a slash: ${ATLAS_URL}`)
......
......@@ -52,7 +52,7 @@ export class AtlasViewerConstantsServices implements OnDestroy {
}
// instead of using window.location.href, which includes query param etc
public backendUrl = BACKEND_URL || `${window.location.origin}${window.location.pathname}`
public backendUrl = `${BACKEND_URL}/`.replace(/\/\/$/, '\/') || `${window.location.origin}${window.location.pathname}`
private fetchTemplate = (templateUrl) => this.http.get(`${this.backendUrl}${templateUrl}`, { responseType: 'json' }).pipe(
switchMap((template: any) => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment