Merge pull request #310 from AndyBernie/patch-1

Update HttpHelper.kt
pull/312/head
kunfei 4 years ago committed by GitHub
commit 83d0d29104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/src/main/java/io/legado/app/help/http/HttpHelper.kt

@ -52,7 +52,7 @@ object HttpHelper {
fun getBytes(url: String, referrer: String): ByteArray? { fun getBytes(url: String, referrer: String): ByteArray? {
NetworkUtils.getBaseUrl(url)?.let { baseUrl -> NetworkUtils.getBaseUrl(url)?.let { baseUrl ->
val headers = val headers =
mapOf(Pair(AppConst.UA_NAME, AppConst.userAgent), Pair("Referrer", referrer)) mapOf(Pair(AppConst.UA_NAME, AppConst.userAgent), Pair("Referer", referrer))
return getByteRetrofit(baseUrl) return getByteRetrofit(baseUrl)
.create(HttpGetApi::class.java) .create(HttpGetApi::class.java)
.getMapByte(url, mapOf(), headers) .getMapByte(url, mapOf(), headers)
@ -132,4 +132,4 @@ object HttpHelper {
webView.load(params) webView.load(params)
} }
} }

Loading…
Cancel
Save