Skip to content

Commit

Permalink
Merge pull request #63 from Ramesh1402/customconfig-autologging
Browse files Browse the repository at this point in the history
fix: auto logging for urlsession with custom configuration
  • Loading branch information
kean committed Jan 25, 2022
2 parents 6df53c3 + fa3c1a4 commit 8cfaeda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/PulseCore/URLSessionProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public extension Experimental {

private func resetSession() {
session.invalidateAndCancel()
session = URLSession(configuration: .default, delegate: URLSessionProxyDelegate(logger: logger, delegate: CustomProtocolSessionDelegate.shared), delegateQueue: CustomProtocolSessionDelegate.shared.queue)
configuration.protocolClasses?.insert(CustomHTTPProtocol.self, at: 0)
session = URLSession(configuration: configuration, delegate: URLSessionProxyDelegate(logger: logger, delegate: CustomProtocolSessionDelegate.shared), delegateQueue: CustomProtocolSessionDelegate.shared.queue)
}
}
}
Expand Down

0 comments on commit 8cfaeda

Please sign in to comment.