1
Fork 0

Fix case of double slash

This commit is contained in:
David Valdez 2023-04-30 17:17:59 -05:00
parent 18c9acfa81
commit efda44a20b
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ const placeholder =
const getProtectedUrl = (url?: string) => { const getProtectedUrl = (url?: string) => {
if (url == undefined) return undefined if (url == undefined) return undefined
const imgUrl = new URL(`${import.meta.env.BASE_URL}/${url}`, location.origin) const imgUrl = new URL(
`${import.meta.env.BASE_URL}${url}`.replace(/\/\//g, '/'),
location.origin
)
const tokenRegex = location.pathname.match(/^\/share\/([\d\w]+)(\/?.*)$/) const tokenRegex = location.pathname.match(/^\/share\/([\d\w]+)(\/?.*)$/)
if (tokenRegex) { if (tokenRegex) {