Skip to content

Commit

Permalink
Merge pull request #26 from Ast3r10n/bugfix/leaks
Browse files Browse the repository at this point in the history
Switch to using ephemeral URLSessionConfigurations
  • Loading branch information
Ast3r10n authored Jan 8, 2021
2 parents c0eee2e + f1fd9b7 commit f70c75b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ fastlane/test_output
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
iOSInjectionProject/
build/
9 changes: 5 additions & 4 deletions Sources/SwiftQuests/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ open class Request: AbstractRequest {
/// The request `URLSession`.
///
/// Defaults to a session with a `default` `URLSessionConfiguration` unless otherwise specified.
public var session = URLSession(configuration: .default)
public var session = URLSession(configuration: .ephemeral)

/// The wrapped `URLRequest` object.
public var urlRequest: URLRequest!
Expand Down Expand Up @@ -138,9 +138,10 @@ open class Request: AbstractRequest {
}

if let credential = credential {
URLCredentialStorage.shared.set(credential,
for: configuration.protectionSpace,
task: task)
URLCredentialStorage.shared.set(
credential,
for: configuration.protectionSpace,
task: task)
}

task.resume()
Expand Down

0 comments on commit f70c75b

Please sign in to comment.