Fix query building

Change-Id: I723eb409211ffe78f184dfc85d4bdcff66510008
diff --git a/cmd/koralmapper/static/config.js b/cmd/koralmapper/static/config.js
index aeda326..a5f9a6c 100644
--- a/cmd/koralmapper/static/config.js
+++ b/cmd/koralmapper/static/config.js
@@ -259,6 +259,15 @@
 
   // Kalamar pipe registration
 
+  function encodePathCfg(cfg) {
+    return encodeURIComponent(cfg).replace(/%3A/gi, ':').replace(/%3B/gi, ';');
+  }
+
+  function buildPipeURL(pipeType, cfg) {
+    if (!cfg) return "";
+    return serviceURL.replace(/\/+$/, "") + "/" + pipeType + "/" + encodePathCfg(cfg);
+  }
+
   var lastQueryPipe = null;
   var lastResponsePipe = null;
 
@@ -290,8 +299,8 @@
       return;
     }
 
-    var newQueryPipe = queryCfg ? serviceURL + "/query?cfg=" + encodeURIComponent(queryCfg) : "";
-    var newResponsePipe = responseCfg ? serviceURL + "/response?cfg=" + encodeURIComponent(responseCfg) : "";
+    var newQueryPipe = buildPipeURL("query", queryCfg);
+    var newResponsePipe = buildPipeURL("response", responseCfg);
 
     if (newQueryPipe === lastQueryPipe && newResponsePipe === lastResponsePipe) return;