Fix detecting repo as user mirror when adding a repo URL with preceeding or trailing whitespace characters

This commit is contained in:
Tobias_Groza
2024-09-02 19:14:53 +02:00
committed by Torsten Grote
parent b670858a38
commit 0a1297ff3d

View File

@@ -104,7 +104,7 @@ class AddRepoActivity : AppCompatActivity() {
}
private fun onFetchRepo(uriStr: String) {
val uri = Uri.parse(uriStr)
val uri = Uri.parse(uriStr.trim())
if (repoManager.isSwapUri(uri)) {
val i = Intent(this, SwapService::class.java).apply {
data = uri
@@ -112,7 +112,7 @@ class AddRepoActivity : AppCompatActivity() {
ContextCompat.startForegroundService(this, i)
} else {
repoManager.abortAddingRepository()
repoManager.fetchRepositoryPreview(uriStr, proxy = NetCipher.getProxy())
repoManager.fetchRepositoryPreview(uri.toString(), proxy = NetCipher.getProxy())
}
}