File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -570,8 +570,8 @@ extension _ProtocolClient : URLProtocolClient {
570
570
func urlProtocolDidFinishLoading( _ protocol: URLProtocol ) {
571
571
guard let task = `protocol`. task else { fatalError ( ) }
572
572
guard let session = task. session as? URLSession else { fatalError ( ) }
573
- guard let response = task. response as? HTTPURLResponse else { fatalError ( " No response " ) }
574
- if response. statusCode == 401 {
573
+ guard let urlResponse = task. response else { fatalError ( " No response " ) }
574
+ if let response = urlResponse as? HTTPURLResponse , response. statusCode == 401 {
575
575
if let protectionSpace = createProtectionSpace ( response) {
576
576
//TODO: Fetch and set proposed credentials if they exist
577
577
let authenticationChallenge = URLAuthenticationChallenge ( protectionSpace: protectionSpace, proposedCredential: nil ,
You can’t perform that action at this time.
0 commit comments