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; }