mirror of
https://github.com/AChep/keyguard-app.git
synced 2025-01-04 18:59:15 +01:00
fix: Do not use Domain match detection for Android and iOS apps URIs
This commit is contained in:
parent
ed90a65b14
commit
6768a31800
@ -23,6 +23,7 @@ class CipherUrlCheckImpl(
|
||||
) : CipherUrlCheck {
|
||||
companion object {
|
||||
private const val PROTOCOL_ANDROID_APP = "androidapp://"
|
||||
private const val PROTOCOL_IOS_APP = "iosapp://"
|
||||
}
|
||||
|
||||
constructor(directDI: DirectDI) : this(
|
||||
@ -37,9 +38,14 @@ class CipherUrlCheckImpl(
|
||||
): IO<Boolean> {
|
||||
return when (uri.match ?: defaultMatchDetection) {
|
||||
DSecret.Uri.MatchType.Domain -> {
|
||||
when {
|
||||
uri.uri.startsWith(PROTOCOL_ANDROID_APP) -> ::checkUrlMatchByHost
|
||||
else -> ::checkUrlMatchByDomain
|
||||
val shouldUseHostMatchInstead = uri.uri.startsWith(PROTOCOL_ANDROID_APP) ||
|
||||
url.startsWith(PROTOCOL_ANDROID_APP) ||
|
||||
uri.uri.startsWith(PROTOCOL_IOS_APP) ||
|
||||
url.startsWith(PROTOCOL_IOS_APP)
|
||||
if (shouldUseHostMatchInstead) {
|
||||
::checkUrlMatchByHost
|
||||
} else {
|
||||
::checkUrlMatchByDomain
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user