mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 23:07:26 -04:00
changed order of chain request
This commit is contained in:
parent
717d593ad3
commit
852deaf57b
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user