mirror of
https://github.com/tale/headplane.git
synced 2026-08-30 08:49:30 +00:00
fix(TALE-34): setting url.protocol does not work anymore
This commit is contained in:
@@ -54,11 +54,14 @@ export default createIntegration<Context>({
|
|||||||
// The API is available as an HTTP endpoint and this
|
// The API is available as an HTTP endpoint and this
|
||||||
// will simplify the fetching logic in undici
|
// will simplify the fetching logic in undici
|
||||||
if (url.protocol === 'tcp:') {
|
if (url.protocol === 'tcp:') {
|
||||||
url.protocol = 'http:'
|
// Apparently setting url.protocol doesn't work anymore?
|
||||||
|
const fetchU = url.href.replace(url.protocol, 'http:')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.info('INTG', 'Checking API: %s', url.href)
|
log.info('INTG', 'Checking API: %s', fetchU)
|
||||||
await fetch(new URL('/v1.30/version', url).href)
|
await fetch(new URL('/v1.30/version', fetchU).href)
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
log.debug('INTG', 'Failed to connect to Docker API', error)
|
||||||
log.error('INTG', 'Failed to connect to Docker API')
|
log.error('INTG', 'Failed to connect to Docker API')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user