服务商获取权限失败的话retry,更换了首页的背景图
This commit is contained in:
25
Pods/Alamofire/Source/SessionDelegate.swift
generated
25
Pods/Alamofire/Source/SessionDelegate.swift
generated
@@ -94,7 +94,7 @@ extension SessionDelegate: URLSessionTaskDelegate {
|
||||
case NSURLAuthenticationMethodHTTPBasic, NSURLAuthenticationMethodHTTPDigest, NSURLAuthenticationMethodNTLM,
|
||||
NSURLAuthenticationMethodNegotiate:
|
||||
evaluation = attemptCredentialAuthentication(for: challenge, belongingTo: task)
|
||||
#if !(os(Linux) || os(Windows))
|
||||
#if canImport(Security)
|
||||
case NSURLAuthenticationMethodServerTrust:
|
||||
evaluation = attemptServerTrustAuthentication(with: challenge)
|
||||
case NSURLAuthenticationMethodClientCertificate:
|
||||
@@ -111,7 +111,7 @@ extension SessionDelegate: URLSessionTaskDelegate {
|
||||
completionHandler(evaluation.disposition, evaluation.credential)
|
||||
}
|
||||
|
||||
#if !(os(Linux) || os(Windows))
|
||||
#if canImport(Security)
|
||||
/// Evaluates the server trust `URLAuthenticationChallenge` received.
|
||||
///
|
||||
/// - Parameter challenge: The `URLAuthenticationChallenge`.
|
||||
@@ -230,6 +230,25 @@ extension SessionDelegate: URLSessionTaskDelegate {
|
||||
// MARK: URLSessionDataDelegate
|
||||
|
||||
extension SessionDelegate: URLSessionDataDelegate {
|
||||
open func urlSession(_ session: URLSession,
|
||||
dataTask: URLSessionDataTask,
|
||||
didReceive response: URLResponse,
|
||||
completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
|
||||
eventMonitor?.urlSession(session, dataTask: dataTask, didReceive: response)
|
||||
|
||||
guard let response = response as? HTTPURLResponse else { completionHandler(.allow); return }
|
||||
|
||||
if let request = request(for: dataTask, as: DataRequest.self) {
|
||||
request.didReceiveResponse(response, completionHandler: completionHandler)
|
||||
} else if let request = request(for: dataTask, as: DataStreamRequest.self) {
|
||||
request.didReceiveResponse(response, completionHandler: completionHandler)
|
||||
} else {
|
||||
assertionFailure("dataTask did not find DataRequest or DataStreamRequest in didReceive response")
|
||||
completionHandler(.allow)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
|
||||
eventMonitor?.urlSession(session, dataTask: dataTask, didReceive: data)
|
||||
|
||||
@@ -238,7 +257,7 @@ extension SessionDelegate: URLSessionDataDelegate {
|
||||
} else if let request = request(for: dataTask, as: DataStreamRequest.self) {
|
||||
request.didReceive(data: data)
|
||||
} else {
|
||||
assertionFailure("dataTask did not find DataRequest or DataStreamRequest in didReceive")
|
||||
assertionFailure("dataTask did not find DataRequest or DataStreamRequest in didReceive data")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user