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 @@ -33,7 +33,8 @@ internal extension OKHTTPClient {
3333 func stream< T: Decodable > ( request: URLRequest , with responseType: T . Type ) -> AsyncThrowingStream < T , Error > {
3434 return AsyncThrowingStream { continuation in
3535 Task {
36- let task = URLSession . shared. dataTask ( with: request)
36+ let session = URLSession ( configuration: . default, delegate: delegate, delegateQueue: . main)
37+ let task = session. dataTask ( with: request)
3738
3839 let delegate = StreamingDelegate (
3940 urlResponseCallback: { response in
@@ -61,7 +62,6 @@ internal extension OKHTTPClient {
6162 continuation. finish ( )
6263 }
6364 )
64- task. delegate = delegate
6565
6666 continuation. onTermination = { terminationState in
6767 // Cancellation of our task should cancel the URLSessionDataTask
You can’t perform that action at this time.
0 commit comments