From 70b1be8c0a265685e51beccf302b40f22f4f6392 Mon Sep 17 00:00:00 2001 From: Diogo Resende Date: Tue, 21 Nov 2023 14:09:36 +0000 Subject: [PATCH] Fix connection config password node being decoded if necessary --- lib/ConnectionConfig.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ConnectionConfig.js b/lib/ConnectionConfig.js index cfab9237..0e7a4480 100644 --- a/lib/ConnectionConfig.js +++ b/lib/ConnectionConfig.js @@ -187,7 +187,11 @@ ConnectionConfig.parseUrl = function(url) { if (typeof url.username == 'string') { options.user = url.username; - options.password = url.password; + try { + options.password = decodeURIComponent(url.password); + } catch (e) { + options.password = url.password; + } } else if (url.auth) { var auth = url.auth.split(':'); options.user = auth.shift();