From 67948198dc6ab48d3f65a256db6e8683fde2fd04 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 9 Apr 2024 13:02:14 -0400 Subject: [PATCH] Make update URLSessions ephemeral --- Whisky/Views/Setup/WhiskyWineDownloadView.swift | 2 +- .../Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Whisky/Views/Setup/WhiskyWineDownloadView.swift b/Whisky/Views/Setup/WhiskyWineDownloadView.swift index 0ebdfd3f..e9196505 100644 --- a/Whisky/Views/Setup/WhiskyWineDownloadView.swift +++ b/Whisky/Views/Setup/WhiskyWineDownloadView.swift @@ -66,7 +66,7 @@ struct WhiskyWineDownloadView: View { .onAppear { Task { if let url: URL = URL(string: "https://data.getwhisky.app/Wine/Libraries.tar.gz") { - downloadTask = URLSession.shared.downloadTask(with: url) { url, _, _ in + downloadTask = URLSession(configuration: .ephemeral).downloadTask(with: url) { url, _, _ in if let url = url { tarLocation = url proceed() diff --git a/WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift b/WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift index 0ccdd344..3c77a3bc 100644 --- a/WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift +++ b/WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift @@ -68,7 +68,7 @@ public class WhiskyWineInstaller { if let remoteUrl = URL(string: versionPlistURL) { remoteVersion = await withCheckedContinuation { continuation in - URLSession.shared.dataTask(with: URLRequest(url: remoteUrl)) { data, _, error in + URLSession(configuration: .ephemeral).dataTask(with: URLRequest(url: remoteUrl)) { data, _, error in do { if error == nil, let data = data { let decoder = PropertyListDecoder()