File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ 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)
37-
3836 let delegate = StreamingDelegate (
3937 urlResponseCallback: { response in
4038 do {
@@ -61,7 +59,9 @@ internal extension OKHTTPClient {
6159 continuation. finish ( )
6260 }
6361 )
64- task. delegate = delegate
62+
63+ let session = URLSession ( configuration: . default, delegate: delegate, delegateQueue: . main)
64+ let task = session. dataTask ( with: request)
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