Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 0c026a8

Browse files
committed
Make sure in-memory data is cleared after using
1 parent 62f2f23 commit 0c026a8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

WordPressKit/HTTPClient.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,9 @@ private extension URLSession {
321321
}
322322

323323
}
324+
325+
extension URLSession {
326+
var debugNumberOfTaskData: Int {
327+
self.taskData.count
328+
}
329+
}

WordPressKitTests/Utilities/URLSessionHelperTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class URLSessionHelperTests: XCTestCase {
1616
override func tearDown() {
1717
super.tearDown()
1818
HTTPStubs.removeAllStubs()
19+
XCTAssertEqual(session.debugNumberOfTaskData, 0)
1920
}
2021

2122
func testConnectionError() async throws {

0 commit comments

Comments
 (0)