From 75bb15d3b792ffa1bad22fea7f205501d39c7908 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Fri, 17 May 2024 20:39:24 -0400 Subject: [PATCH] Revert "server: make fetching network interfaces optional (#1474)" (#1478) This reverts commit 0160502da865a45c894af5ddb5c909043698c70a. --- server/src/server-settings.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/server/src/server-settings.ts b/server/src/server-settings.ts index 017e79a135..82899a4c58 100644 --- a/server/src/server-settings.ts +++ b/server/src/server-settings.ts @@ -29,14 +29,7 @@ function nodeIpAddress(family: number): string[] { ...costlyNetworks, ]; - let interfaces: any; - try { - interfaces = os.networkInterfaces(); - } catch { - // bjia56: When running in secured environments like UserLAnd in Android, os.networkInterfaces() - // is unable to get addresses and throws an error. Therefore, assume we can't find any addresses. - return []; - } + const interfaces = os.networkInterfaces(); const all = Object.keys(interfaces) .map((nic) => {