Do ```base = normalize_uri(target_uri.path, "")``` to ensure a "/" at the end.