From 1d821251a925487de463da5c4f820db39af57d89 Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Wed, 2 Oct 2024 12:59:42 -0400 Subject: [PATCH] fix(TALE-34): setting url.protocol does not work anymore --- app/integration/docker.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/integration/docker.ts b/app/integration/docker.ts index b2e501b..92371ac 100644 --- a/app/integration/docker.ts +++ b/app/integration/docker.ts @@ -54,11 +54,14 @@ export default createIntegration({ // The API is available as an HTTP endpoint and this // will simplify the fetching logic in undici if (url.protocol === 'tcp:') { - url.protocol = 'http:' + // Apparently setting url.protocol doesn't work anymore? + const fetchU = url.href.replace(url.protocol, 'http:') + try { - log.info('INTG', 'Checking API: %s', url.href) - await fetch(new URL('/v1.30/version', url).href) - } catch { + log.info('INTG', 'Checking API: %s', fetchU) + await fetch(new URL('/v1.30/version', fetchU).href) + } catch (error) { + log.debug('INTG', 'Failed to connect to Docker API', error) log.error('INTG', 'Failed to connect to Docker API') return false }