mirror of
https://github.com/bitwarden/ios.git
synced 2025-12-13 02:58:59 -06:00
18 lines
471 B
Swift
18 lines
471 B
Swift
import Networking
|
|
|
|
@MainActor
|
|
class TestResponseHandler: ResponseHandler {
|
|
var handledResponse: HTTPResponse?
|
|
var responseHandler: ((inout HTTPResponse) -> Void)?
|
|
|
|
init(_ responseHandler: ((inout HTTPResponse) -> Void)?) {
|
|
self.responseHandler = responseHandler
|
|
}
|
|
|
|
func handle(_ response: inout HTTPResponse) async throws -> HTTPResponse {
|
|
handledResponse = response
|
|
responseHandler?(&response)
|
|
return response
|
|
}
|
|
}
|