Set the User-Agent header to "Nix/<version>"
This commit is contained in:
parent
b74d92755d
commit
d287b62b64
|
@ -1,5 +1,7 @@
|
||||||
package Nix::Config;
|
package Nix::Config;
|
||||||
|
|
||||||
|
$version = "@version@";
|
||||||
|
|
||||||
$binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
|
$binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
|
||||||
$libexecDir = $ENV{"NIX_LIBEXEC_DIR"} || "@libexecdir@";
|
$libexecDir = $ENV{"NIX_LIBEXEC_DIR"} || "@libexecdir@";
|
||||||
$stateDir = $ENV{"NIX_STATE_DIR"} || "@localstatedir@/nix";
|
$stateDir = $ENV{"NIX_STATE_DIR"} || "@localstatedir@/nix";
|
||||||
|
|
|
@ -41,6 +41,7 @@ sub addRequest {
|
||||||
$curl->setopt(CURLOPT_WRITEDATA, \$requests{$curlId}->{content});
|
$curl->setopt(CURLOPT_WRITEDATA, \$requests{$curlId}->{content});
|
||||||
$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
|
$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
|
||||||
$curl->setopt(CURLOPT_CAINFO, $caBundle) if defined $caBundle;
|
$curl->setopt(CURLOPT_CAINFO, $caBundle) if defined $caBundle;
|
||||||
|
$curl->setopt(CURLOPT_USERAGENT, "Nix/$Nix::Config::version");
|
||||||
$curl->setopt(CURLOPT_NOBODY, 1) if $head;
|
$curl->setopt(CURLOPT_NOBODY, 1) if $head;
|
||||||
|
|
||||||
if ($activeRequests >= $maxParallelRequests) {
|
if ($activeRequests >= $maxParallelRequests) {
|
||||||
|
|
Loading…
Reference in a new issue