Modified to fix an issue with cockpit trying to be launched with a broken URL.

My FreedomBox App


fun urlJoin(vararg urls: String): String {
    var ret_orig = urls.map { it.trim('/') }.joinToString(separator = "/")
    // Preserve trailing '/' in last item
    var last_string = urls.last()
    if (last_string.length > 1){
	    if (last_string.last() == '/') {
			return ret_orig + '/'
	    }
    }
    return ret_orig
}