From de0a494b436521596cc8df1cdcf310def4ff8338 Mon Sep 17 00:00:00 2001 From: Antoine POPINEAU Date: Wed, 8 Jul 2020 15:12:49 +0200 Subject: [PATCH] Do not transform URLs to HTTPS now that we support cleartext connections. --- app/src/main/java/com/github/apognu/otter/utils/Util.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/java/com/github/apognu/otter/utils/Util.kt b/app/src/main/java/com/github/apognu/otter/utils/Util.kt index fcc5c4a..9d3a3f4 100644 --- a/app/src/main/java/com/github/apognu/otter/utils/Util.kt +++ b/app/src/main/java/com/github/apognu/otter/utils/Util.kt @@ -5,7 +5,6 @@ import android.widget.Toast import com.google.android.exoplayer2.util.Log import com.preference.PowerPreference import java.net.URI -import java.net.URL fun Context?.toast(message: String, length: Int = Toast.LENGTH_SHORT) { if (this != null) { @@ -35,9 +34,7 @@ fun mustNormalizeUrl(rawUrl: String): String { val fallbackHost = PowerPreference.getFileByName(AppContext.PREFS_CREDENTIALS).getString("hostname") val uri = URI(rawUrl).takeIf { it.host != null } ?: URI("$fallbackHost$rawUrl") - return uri.toURL().run { - URL("https", host, file) - }.toString() + return uri.toString() } fun toDurationString(duration: Long, showSeconds: Boolean = false): String {