Fix case of double slash

This commit is contained in:
David Valdez
2023-04-30 17:17:59 -05:00
parent 18c9acfa81
commit efda44a20b

View File

@@ -13,7 +13,10 @@ const placeholder =
const getProtectedUrl = (url?: string) => {
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]+)(\/?.*)$/)
if (tokenRegex) {