Skip to content

Commit

Permalink
Merge pull request #95 from venmo/chore/ExposeCurrentRequest
Browse files Browse the repository at this point in the history
Expose currentRequest in SessionDataTask
  • Loading branch information
dmiluski authored Nov 5, 2019
2 parents 7cfc451 + 291e5e4 commit cb9cc81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/DVR/SessionDataTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ final class SessionDataTask: URLSessionDataTask {
return interaction?.response
}

override var currentRequest: URLRequest? {
return request
}


// MARK: - Initializers

Expand Down
2 changes: 2 additions & 0 deletions Tests/DVRTests/SessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class SessionTests: XCTestCase {
} else {
XCTFail()
}

XCTAssertEqual(dataTask.currentRequest?.url?.absoluteString, request.url?.absoluteString)
}

func testDataTaskWithCompletion() {
Expand Down

0 comments on commit cb9cc81

Please sign in to comment.