mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -218,6 +218,19 @@ interface JsExtensions {
|
||||
.execute()
|
||||
}
|
||||
|
||||
/**
|
||||
* js实现重定向拦截,网络访问head,不返回Response Body更省流量
|
||||
*/
|
||||
fun head(urlStr: String, headers: Map<String, String>): Connection.Response {
|
||||
return Jsoup.connect(urlStr)
|
||||
.sslSocketFactory(SSLHelper.unsafeSSLSocketFactory)
|
||||
.ignoreContentType(true)
|
||||
.followRedirects(false)
|
||||
.headers(headers)
|
||||
.method(Connection.Method.HEAD)
|
||||
.execute()
|
||||
}
|
||||
|
||||
/**
|
||||
* 网络访问post
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user