Skip to content

Commit 2e30787

Browse files
committed
add setHeader(name: String, value: String) -> Self
1 parent 686a476 commit 2e30787

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/PostgREST/PostgrestBuilder.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ public class PostgrestBuilder: @unchecked Sendable {
5252

5353
/// Set a HTTP header for the request.
5454
@discardableResult
55-
public func setHeader(name: HTTPField.Name, value: String) -> Self {
55+
public func setHeader(name: String, value: String) -> Self {
56+
return self.setHeader(name: .init(name)!, value: value)
57+
}
58+
59+
/// Set a HTTP header for the request.
60+
@discardableResult
61+
internal func setHeader(name: HTTPField.Name, value: String) -> Self {
5662
mutableState.withValue {
5763
$0.request.headers[name] = value
5864
}

0 commit comments

Comments
 (0)