1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00

Fix endless encoding loop with screen URLs

This commit is contained in:
Andrew Kingston 2022-04-07 12:23:17 +01:00
parent 43a8efc24d
commit 07c8bc4af8

View file

@ -2,9 +2,14 @@ export default function (url) {
return url
.split("/")
.map(part => {
// if parameter, then use as is
if (part.startsWith(":")) return part
return encodeURIComponent(part.replace(/ /g, "-"))
part = decodeURIComponent(part)
// If parameter, then use as is
if (!part.startsWith(":")) {
part = encodeURIComponent(part)
}
return part.replace(/ /g, "-")
})
.join("/")
.toLowerCase()