Skip to content

Commit 5ec7a29

Browse files
dhsloveycyun
andauthored
Replace multiple + and / symbols by - and _ to have URL-safe base64 going to the API (#5593)
Co-authored-by: YeoCheon Yun <ycyun@ycyun.xyz>
1 parent 6f88220 commit 5ec7a29

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ui/src/views/infra/AddPrimaryStorage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ export default {
504504
/* Replace the + and / symbols by - and _ to have URL-safe base64 going to the API
505505
It's hacky, but otherwise we'll confuse java.net.URI which splits the incoming URI
506506
*/
507-
secret = secret.replace('+', '-')
508-
secret = secret.replace('/', '_')
507+
secret = secret.replace(/\+/g, '-')
508+
secret = secret.replace(/\//g, '_')
509509
if (id !== null && secret !== null) {
510510
monitor = id + ':' + secret + '@' + monitor
511511
}

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,8 +2099,8 @@ export default {
20992099
},
21002100
rbdURL (monitor, pool, id, secret) {
21012101
let url
2102-
secret = secret.replace('+', '-')
2103-
secret = secret.replace('/', '_')
2102+
secret = secret.replace(/\+/g, '-')
2103+
secret = secret.replace(/\//g, '_')
21042104
if (id != null && secret != null) {
21052105
monitor = id + ':' + secret + '@' + monitor
21062106
}

0 commit comments

Comments
 (0)