Skip to content

Commit

Permalink
Use curl for download on windows when proxy auth is required (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvlecl authored Jul 5, 2024
1 parent 9e362d2 commit 968b4f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/vcpkg/base/downloads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,14 @@ namespace vcpkg
download_path_part_path += ".part";

#if defined(_WIN32)
if (headers.size() == 0)
auto maybe_https_proxy_env = get_environment_variable(EnvironmentVariableHttpsProxy);
bool needs_proxy_auth = false;
if (maybe_https_proxy_env)
{
const auto& proxy_url = maybe_https_proxy_env.value_or_exit(VCPKG_LINE_INFO);
needs_proxy_auth = proxy_url.find('@') != std::string::npos;
}
if (headers.size() == 0 && !needs_proxy_auth)
{
auto split_uri = split_uri_view(url).value_or_exit(VCPKG_LINE_INFO);
auto authority = split_uri.authority.value_or_exit(VCPKG_LINE_INFO).substr(2);
Expand Down

0 comments on commit 968b4f4

Please sign in to comment.