mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 09:06:15 +02:00
c++-ize the proxy detection code
Just for consistency with the rest
This commit is contained in:
parent
d3bff699aa
commit
bca737dcad
1 changed files with 2 additions and 3 deletions
|
@ -23,7 +23,6 @@
|
|||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <regex>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
|
@ -35,7 +34,7 @@ namespace nix {
|
|||
|
||||
static bool haveProxyEnvironmentVariables()
|
||||
{
|
||||
static const char * const proxyVariables[] = {
|
||||
static const std::vector<std::string> proxyVariables = {
|
||||
"http_proxy",
|
||||
"https_proxy",
|
||||
"ftp_proxy",
|
||||
|
@ -44,7 +43,7 @@ static bool haveProxyEnvironmentVariables()
|
|||
"FTP_PROXY"
|
||||
};
|
||||
for (auto & proxyVariable: proxyVariables) {
|
||||
if (std::getenv(proxyVariable)) {
|
||||
if (getEnv(proxyVariable).has_value()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue