http: move use_proxy from connection to client

This commit is contained in:
Pierre Tachoire
2025-08-22 11:58:48 +02:00
parent e61d787ff0
commit a7516061d0
2 changed files with 7 additions and 11 deletions

View File

@@ -94,7 +94,6 @@ pub const Connection = struct {
opts: Connection.Opts,
const Opts = struct {
use_proxy: bool,
proxy_bearer_token: ?[:0]const u8,
};
@@ -113,10 +112,8 @@ pub const Connection = struct {
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_REDIR_PROTOCOLS_STR, "HTTP,HTTPS")); // remove FTP and FTPS from the default
// proxy
var use_proxy = false;
if (opts.http_proxy) |proxy| {
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_PROXY, proxy.ptr));
use_proxy = true;
}
// tls
@@ -158,7 +155,6 @@ pub const Connection = struct {
return .{
.easy = easy,
.opts = .{
.use_proxy = use_proxy,
.proxy_bearer_token = opts.proxy_bearer_token,
},
};