Fixed typo with cleanupAndRemovePath

This commit is contained in:
Robinson 2022-06-07 23:11:00 +02:00
parent e542502df2
commit 8cd8e9d1be
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -136,7 +136,14 @@ object WebUtil {
* https://www.aa.foo.com%foobar --> https://www.aa.foo.com
*/
fun cleanupAndRemovePath(fullDomainName: String): String {
val start = 0
var start = fullDomainName.indexOf("://")
if (start == -1) {
start = 0
}
else {
start += 3 // 3 is the length of ://
}
var end = fullDomainName.length
val slash = fullDomainName.indexOf("/", start + 3)
@ -165,7 +172,7 @@ object WebUtil {
}
return fullDomainName.substring(start, end)
return fullDomainName.substring(0, end)
}