From 7ad9705cd713d61bf356e648947bfcb7d8c936b9 Mon Sep 17 00:00:00 2001 From: David White Date: Fri, 9 Aug 2024 15:24:36 +0100 Subject: [PATCH] Add fix for uncatchable dns error --- lib/modem.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/modem.js b/lib/modem.js index 6e60587..cc476e5 100644 --- a/lib/modem.js +++ b/lib/modem.js @@ -140,6 +140,11 @@ Modem.prototype.dial = function (options, callback) { delete opts.abortSignal; } + // Prevent uncatchable dns error + if (options.path.startsWith('/')) { + throw new Error('Path cannot start with a backslash'); + } + if (this.version) { options.path = '/' + this.version + options.path; }