Replace multiple + and / symbols by - and _ to have URL-safe base64 going to the API (#5593)

Co-authored-by: YeoCheon Yun <ycyun@ycyun.xyz>
This commit is contained in:
DH Park 2021-10-24 06:29:28 +09:00 committed by GitHub
parent 6f8822099d
commit 5ec7a29a2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -504,8 +504,8 @@ export default {
/* 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, '-')
secret = secret.replace(/\//g, '_')
if (id !== null && secret !== null) {
monitor = id + ':' + secret + '@' + monitor
}

View File

@ -2099,8 +2099,8 @@ export default {
},
rbdURL (monitor, pool, id, secret) {
let url
secret = secret.replace('+', '-')
secret = secret.replace('/', '_')
secret = secret.replace(/\+/g, '-')
secret = secret.replace(/\//g, '_')
if (id != null && secret != null) {
monitor = id + ':' + secret + '@' + monitor
}