You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2012/07/24 23:25:19 UTC

git commit: rbd: Make the base64 going to the API URL-safe

Updated Branches:
  refs/heads/rbd 665c0d759 -> d66fa434a


rbd: Make the base64 going to the API URL-safe

Otherwise we'll run into troubles when java.net.URI tries to split the URI.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d66fa434
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d66fa434
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d66fa434

Branch: refs/heads/rbd
Commit: d66fa434a3030df94a0f63c119baf2c19d0c9c7f
Parents: 665c0d7
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Tue Jul 24 23:24:38 2012 +0200
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Tue Jul 24 23:24:38 2012 +0200

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d66fa434/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 85908dc..4367301 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -478,6 +478,13 @@ function SharedMountPointURL(server, path) {
 function rbdURL(monitor, pool, id, secret) {
 	var url;
 
+	/*
+	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 = str.replace("+", "-");
+	secret = str.replace("/", "_");
+
 	if (id != null && secret != null) {
 		monitor = id + ":" + secret + "@" + monitor;
 	}