mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 07:16:04 -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
|
return url
|
||||||
.openConnection()
|
.openConnection()
|
||||||
.apply {
|
.apply {
|
||||||
connect()
|
|
||||||
if (urlString.isAuthenticationUrl){
|
if (urlString.isAuthenticationUrl){
|
||||||
setRequestProperty(
|
setRequestProperty(
|
||||||
"Authorization",
|
"Authorization",
|
||||||
"Basic ${Base64.getEncoder().encodeToString(System.getenv(secretKey).toByteArray())}"
|
"Basic ${Base64.getEncoder().encodeToString(System.getenv(secretKey).toByteArray())}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
connect()
|
||||||
getInputStream()
|
getInputStream()
|
||||||
}.let {
|
}.let {
|
||||||
it.getHeaderField("Location")?.replace("https", "http") ?: it.url.toString()
|
it.getHeaderField("Location")?.replace("https", "http") ?: it.url.toString()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user