Skip to content

Commit

Permalink
1.26.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dankinsoid committed Jun 17, 2024
1 parent 8f0fc37 commit abd349f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/SwiftAPIClient/Types/HTTPFields.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ public extension HTTPField {
return HTTPField(name: .contentDisposition, value: value)
}

/// Returns a `Basic` `Proxy-Authorization` header using the `username` and `password` provided.
///
/// - Parameters:
/// - username: The username of the header.
/// - password: The password of the header.
///
/// - Returns: The header.
static func proxyAuthorization(username: String, password: String) -> HTTPField {
let credential = Data("\(username):\(password)".utf8).base64EncodedString()
return HTTPField(name: .proxyAuthorization, value: "Basic \(credential)")
}

/// Returns a `Content-Encoding` header.
///
/// - Parameter value: The `Content-Encoding`.
Expand Down

0 comments on commit abd349f

Please sign in to comment.