Skip to content

Commit

Permalink
Fixed iOS 12 build
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Mar 23, 2023
1 parent c1c555b commit 3897bb9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Sources/Networking/HTTPClient/RedirectLoggerTaskDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ import Foundation
/// Implementation of `URLSessionTaskDelegate` that logs when the task will perform a redirection.
final class RedirectLoggerSessionDelegate: NSObject, URLSessionTaskDelegate {

func urlSession(_ session: URLSession,
task: URLSessionTask,
willPerformHTTPRedirection response: HTTPURLResponse,
newRequest request: URLRequest
) async -> URLRequest? {
func urlSession(
_ session: URLSession,
task: URLSessionTask,
willPerformHTTPRedirection response: HTTPURLResponse,
newRequest request: URLRequest,
completionHandler: @escaping (URLRequest?) -> Void
) {
if let responseURL = response.url, let requestURL = request.url {
Logger.debug(Strings.network.api_request_redirect(from: responseURL,
to: requestURL))
}

return request
completionHandler(request)
}

}

0 comments on commit 3897bb9

Please sign in to comment.