mirror of
https://github.com/mas-cli/mas
synced 2024-11-25 13:00:23 +00:00
commit
99bd7533b1
1 changed files with 7 additions and 1 deletions
|
@ -19,8 +19,14 @@ public class NetworkManager {
|
||||||
/// Designated initializer
|
/// Designated initializer
|
||||||
///
|
///
|
||||||
/// - Parameter session: A networking session.
|
/// - Parameter session: A networking session.
|
||||||
public init(session: NetworkSession = URLSession.shared) {
|
public init(session: NetworkSession = URLSession(configuration: .ephemeral)) {
|
||||||
self.session = session
|
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.
|
/// Loads data asynchronously.
|
||||||
|
|
Loading…
Reference in a new issue