mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 22:42:41 +01:00
Detect redirect loops
Fixes #2225.
(cherry picked from commit b920b90857)
This commit is contained in:
parent
2a2b1ac083
commit
811645ed01
1 changed files with 2 additions and 0 deletions
|
|
@ -220,6 +220,7 @@ struct CurlDownloader : public Downloader
|
||||||
|
|
||||||
curl_easy_setopt(req, CURLOPT_URL, request.uri.c_str());
|
curl_easy_setopt(req, CURLOPT_URL, request.uri.c_str());
|
||||||
curl_easy_setopt(req, CURLOPT_FOLLOWLOCATION, 1L);
|
curl_easy_setopt(req, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
|
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 +
|
||||||
|
|
@ -340,6 +341,7 @@ struct CurlDownloader : public Downloader
|
||||||
case CURLE_INTERFACE_FAILED:
|
case CURLE_INTERFACE_FAILED:
|
||||||
case CURLE_UNKNOWN_OPTION:
|
case CURLE_UNKNOWN_OPTION:
|
||||||
case CURLE_SSL_CACERT_BADFILE:
|
case CURLE_SSL_CACERT_BADFILE:
|
||||||
|
case CURLE_TOO_MANY_REDIRECTS:
|
||||||
err = Misc;
|
err = Misc;
|
||||||
break;
|
break;
|
||||||
default: // Shut up warnings
|
default: // Shut up warnings
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue