changed order of chain request

This commit is contained in:
Gouri Panda 2023-10-08 01:14:08 +05:30
parent 717d593ad3
commit 852deaf57b

View File

@ -71,13 +71,13 @@ fun ProductFlavor.fetchUrl(): String {
return url
.openConnection()
.apply {
connect()
if (urlString.isAuthenticationUrl){
setRequestProperty(
"Authorization",
"Basic ${Base64.getEncoder().encodeToString(System.getenv(secretKey).toByteArray())}"
)
}
connect()
getInputStream()
}.let {
it.getHeaderField("Location")?.replace("https", "http") ?: it.url.toString()