From 2f190d26225ac3627f56efff588eb22e25d985a2 Mon Sep 17 00:00:00 2001 From: Darrin Husselmann Date: Fri, 9 Oct 2020 17:24:55 +0200 Subject: [PATCH] Fixed double slash in secret breaking db insert --- 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 c13af41deb8e..3ded9908861a 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;