Fix endless encoding loop with screen URLs
This commit is contained in:
parent
c6d1757f7d
commit
6c6b7fe411
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue