Skip to content

Commit fad6895

Browse files
committed
http: add creds into request
1 parent 7869159 commit fad6895

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/http/Client.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ fn makeRequest(self: *Client, handle: *Handle, transfer: *Transfer) !void {
325325
}
326326

327327
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_PRIVATE, transfer));
328+
329+
// add credentials
330+
if (req.credentials) |creds| {
331+
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_PROXYUSERPWD, creds.ptr));
332+
}
328333
}
329334

330335
// Once soon as this is called, our "perform" loop is responsible for
@@ -542,6 +547,7 @@ pub const Request = struct {
542547
body: ?[]const u8 = null,
543548
cookie_jar: *CookieJar,
544549
resource_type: ResourceType,
550+
credentials: ?[:0]const u8 = null,
545551

546552
// arbitrary data that can be associated with this request
547553
ctx: *anyopaque = undefined,

0 commit comments

Comments
 (0)