Fix endless encoding loop with screen URLs
This commit is contained in:
parent
43a8efc24d
commit
07c8bc4af8
|
@ -2,9 +2,14 @@ export default function (url) {
|
||||||
return url
|
return url
|
||||||
.split("/")
|
.split("/")
|
||||||
.map(part => {
|
.map(part => {
|
||||||
// if parameter, then use as is
|
part = decodeURIComponent(part)
|
||||||
if (part.startsWith(":")) return part
|
|
||||||
return encodeURIComponent(part.replace(/ /g, "-"))
|
// If parameter, then use as is
|
||||||
|
if (!part.startsWith(":")) {
|
||||||
|
part = encodeURIComponent(part)
|
||||||
|
}
|
||||||
|
|
||||||
|
return part.replace(/ /g, "-")
|
||||||
})
|
})
|
||||||
.join("/")
|
.join("/")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
|
|
Loading…
Reference in New Issue