mirror of
https://github.com/bitwarden/ios.git
synced 2025-12-11 22:17:55 -06:00
13 lines
549 B
Swift
13 lines
549 B
Swift
/// A protocol for an object that can view or modify `HTTPRequest` objects before they are sent by
|
|
/// the `HTTPClient`.
|
|
///
|
|
public protocol RequestHandler: Sendable {
|
|
/// Handles receiving a `HTTPRequest`. The handler can view or modify the request before
|
|
/// returning it to continue to handler chain.
|
|
///
|
|
/// - Parameter request: The `HTTPRequest` that will be sent by the `HTTPClient`.
|
|
/// - Returns: The original or modified `HTTPRequest`.
|
|
///
|
|
func handle(_ request: inout HTTPRequest) async throws -> HTTPRequest
|
|
}
|