mirror of
https://github.com/mas-cli/mas
synced 2024-11-21 19:23:01 +00:00
commit
99bd7533b1
1 changed files with 7 additions and 1 deletions
|
@ -19,8 +19,14 @@ public class NetworkManager {
|
|||
/// Designated initializer
|
||||
///
|
||||
/// - Parameter session: A networking session.
|
||||
public init(session: NetworkSession = URLSession.shared) {
|
||||
public init(session: NetworkSession = URLSession(configuration: .ephemeral)) {
|
||||
self.session = session
|
||||
|
||||
// Older releases allowed URLSession to write a cache. We clean it up here.
|
||||
do {
|
||||
let url = URL(fileURLWithPath: NSHomeDirectory()).appendingPathComponent("Library/Caches/com.mphys.mas-cli")
|
||||
try FileManager.default.removeItem(at: url)
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/// Loads data asynchronously.
|
||||
|
|
Loading…
Reference in a new issue