Skip to content

Commit

Permalink
Merge pull request #69 from MinaShehata/fix/RD-67-some-request-cancel…
Browse files Browse the repository at this point in the history
…ed-when-RD-is-enabled

[RD-67] Add completion handler to URLProtocol class method: Will perform redirection …
  • Loading branch information
DamianMarkowski authored Jan 24, 2023
2 parents f4c120e + 5897be4 commit 55ec742
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ResponseDetective/Sources/URLProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import Foundation
/// - SeeAlso: URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)
internal func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) {
client?.urlProtocol(self, wasRedirectedTo: request, redirectResponse: response)
completionHandler(request)
}

/// - SeeAlso: URLSessionTaskDelegate.urlSession(_:task:didCompleteWithError:)
Expand Down

0 comments on commit 55ec742

Please sign in to comment.