From 52f4ce06f533ffc4f0eb0031801f52d3ebdab595 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 3 Nov 2021 20:32:53 +0530 Subject: Allow unauthenticated HTTPS Git access (#1533) --- app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt index 072c1c1c..e6915853 100644 --- a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt +++ b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt @@ -149,7 +149,9 @@ constructor( in listOf("ssh", null) -> Protocol.Ssh else -> return UpdateConnectionSettingsResult.FailedToParseUrl } - if (newAuthMode != AuthMode.None && parsedUrl.user.isNullOrBlank()) + if ((newAuthMode != AuthMode.None && newProtocol != Protocol.Https) && + parsedUrl.user.isNullOrBlank() + ) return UpdateConnectionSettingsResult.MissingUsername(newProtocol) val validHttpsAuth = listOf(AuthMode.None, AuthMode.Password) val validSshAuth = listOf(AuthMode.OpenKeychain, AuthMode.Password, AuthMode.SshKey) -- cgit v1.2.3