1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 22:33:57 +02:00

Include DeterminateNix in the User-Agent header

The User-Agent now shows `curl/8.11.0 Nix/2.26.3
DeterminateNix/3.0.0`. This is useful for distinguishing Determinate
Nix from upstream Nix in binary cache logs.
This commit is contained in:
Eelco Dolstra 2025-02-28 16:16:53 +01:00
parent 1b00094110
commit 288c5b0abd

View file

@ -324,7 +324,9 @@ struct curlFileTransfer : public FileTransfer
curl_easy_setopt(req, CURLOPT_MAXREDIRS, 10); curl_easy_setopt(req, CURLOPT_MAXREDIRS, 10);
curl_easy_setopt(req, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(req, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(req, CURLOPT_USERAGENT, curl_easy_setopt(req, CURLOPT_USERAGENT,
("curl/" LIBCURL_VERSION " Nix/" + nixVersion + ("curl/" LIBCURL_VERSION
" Nix/" + nixVersion +
" DeterminateNix/" + determinateNixVersion +
(fileTransferSettings.userAgentSuffix != "" ? " " + fileTransferSettings.userAgentSuffix.get() : "")).c_str()); (fileTransferSettings.userAgentSuffix != "" ? " " + fileTransferSettings.userAgentSuffix.get() : "")).c_str());
#if LIBCURL_VERSION_NUM >= 0x072b00 #if LIBCURL_VERSION_NUM >= 0x072b00
curl_easy_setopt(req, CURLOPT_PIPEWAIT, 1); curl_easy_setopt(req, CURLOPT_PIPEWAIT, 1);