You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix isOnline() to fall back to HTTP HEAD when DNS fails behind proxy
In enterprise proxy environments, the client machine may not resolve
external DNS directly — DNS resolution is handled by the proxy server.
The existing DNS-only check in isOnline() would incorrectly report the
machine as offline, causing unnecessary fallback to cached/offline installs.
When DNS resolution fails and the axios client is available, isOnline()
now attempts a lightweight HEAD request to www.microsoft.com through the
auto-detected (or manually configured) proxy. This ensures connectivity
is correctly detected in proxy environments while keeping DNS as the
fast-path for non-proxy setups.
Refactors GetProxyAgentIfNeeded by extracting proxy resolution into a
standalone getProxyAgent method that does not depend on IAcquisitionWorkerContext.
This allows isOnline and other callers without a full context to reuse
the same proxy detection logic without duplication.
Fixes#2594
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ctx.eventStream.post(newSuppressedAcquisitionError(error,`The proxy lookup failed, most likely due to limited registry access. Skipping automatic proxy lookup.`));
401
+
eventStream?.post(newSuppressedAcquisitionError(error,`The proxy lookup failed, most likely due to limited registry access. Skipping automatic proxy lookup.`));
352
402
}
353
403
354
404
returnnull;
@@ -485,11 +535,6 @@ If you're on a proxy and disable registry access, you must set the proxy in our
0 commit comments