From 2ad60d0c5fa6a939ad75cc945cb19f02ba833d6b Mon Sep 17 00:00:00 2001 From: Spaceman1984 <49917670+Spaceman1984@users.noreply.github.com> Date: Fri, 20 Nov 2020 17:34:58 +0200 Subject: [PATCH] ui: Fixed double slash in secret breaking db insert (#4392) --- ui/scripts/sharedFunctions.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index c13af41deb8..3ded9908861 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -1824,8 +1824,7 @@ var processPropertiesInImagestoreObject = function(jsonObj) { Replace the + and / symbols by - and _ to have URL-safe base64 going to the API It's hacky, but otherwise we'll confuse java.net.URI which splits the incoming URI */ - secret = secret.replace("+", "-"); - secret = secret.replace("/", "_"); + secret = secret.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, ''); if (id != null && secret != null) { monitor = id + ":" + secret + "@" + monitor;