fix(settings): accept dictionary source URLs over https only
The platform blocks cleartext traffic by default, so an http:// source passed validation but could never download and failed with a misleading network error. The validator now rejects http:// upfront.
This commit is contained in:
1 parent
cd589b30a4
commit
c90f658bfe
3 files changed
+3
-3
No files matched your search
@@ -106,7 +106,7 @@ data class DictionarySource(
|
||||
return when {
|
||||
trimmed.isBlank() -> ValidationResult.Error(ValidationError.EMPTY)
|
||||
trimmed.length > 2048 -> ValidationResult.Error(ValidationError.TOO_LONG)
|
||||
!trimmed.startsWith("http://") && !trimmed.startsWith("https://") ->
|
||||
!trimmed.startsWith("https://") ->
|
||||
ValidationResult.Error(ValidationError.INVALID_PROTOCOL)
|
||||
!lowerTemplate.endsWith(".gz") &&
|
||||
!lowerTemplate.endsWith(".dsl") &&
|
||||
|
||||
Reference in new issue
Block a user