pull/312/head
gedoor 4 years ago
parent e9b8e7f313
commit 1da76aa4e6
  1. 4
      app/src/main/java/io/legado/app/help/http/HttpHelper.kt

@ -49,10 +49,10 @@ object HttpHelper {
return null return null
} }
fun getBytes(url: String, referrer: String): ByteArray? { fun getBytes(url: String, referer: String): ByteArray? {
NetworkUtils.getBaseUrl(url)?.let { baseUrl -> NetworkUtils.getBaseUrl(url)?.let { baseUrl ->
val headers = val headers =
mapOf(Pair(AppConst.UA_NAME, AppConst.userAgent), Pair("Referer", referrer)) mapOf(Pair(AppConst.UA_NAME, AppConst.userAgent), Pair("Referer", referer))
return getByteRetrofit(baseUrl) return getByteRetrofit(baseUrl)
.create(HttpGetApi::class.java) .create(HttpGetApi::class.java)
.getMapByte(url, mapOf(), headers) .getMapByte(url, mapOf(), headers)

Loading…
Cancel
Save