diff --git a/packages/safe-chain/src/registryProxy/isImdsEndpoint.js b/packages/safe-chain/src/registryProxy/isImdsEndpoint.js index 2bde02a..deccf10 100644 --- a/packages/safe-chain/src/registryProxy/isImdsEndpoint.js +++ b/packages/safe-chain/src/registryProxy/isImdsEndpoint.js @@ -5,7 +5,7 @@ const imdsEndpoints = [ "metadata.google.internal", "metadata.goog", - "169.254.169.254", + "169.254.169.254", // AWS, Azure, Oracle Cloud, GCP ]; export function isImdsEndpoint(/** @type {string} */ host) { diff --git a/packages/safe-chain/src/registryProxy/tunnelRequestHandler.js b/packages/safe-chain/src/registryProxy/tunnelRequestHandler.js index 9288ec3..b97799b 100644 --- a/packages/safe-chain/src/registryProxy/tunnelRequestHandler.js +++ b/packages/safe-chain/src/registryProxy/tunnelRequestHandler.js @@ -76,13 +76,17 @@ function tunnelRequestToDestination(req, clientSocket, head) { serverSocket.on("timeout", () => { timedoutEndpoints.push(hostname); // Suppress error logging for IMDS endpoints - timeouts are expected when not in cloud - if (isImdsEndpoint(hostname)) { + if (isImds) { ui.writeVerbose( - `Safe-chain: connect to ${hostname}:${port || 443} timed out after ${connectTimeout}ms` + `Safe-chain: connect to ${hostname}:${ + port || 443 + } timed out after ${connectTimeout}ms` ); } else { ui.writeError( - `Safe-chain: connect to ${hostname}:${port || 443} timed out after ${connectTimeout}ms` + `Safe-chain: connect to ${hostname}:${ + port || 443 + } timed out after ${connectTimeout}ms` ); } serverSocket.destroy(); // Clean up socket to prevent event loop hanging @@ -98,7 +102,7 @@ function tunnelRequestToDestination(req, clientSocket, head) { }); serverSocket.on("error", (err) => { - if (isImdsEndpoint(hostname)) { + if (isImds) { ui.writeVerbose( `Safe-chain: error connecting to ${hostname}:${port} - ${err.message}` );