ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbeerbo...@apache.org
Subject ambari git commit: AMBARI-11229 - Views: AmbariStreamProvider is encoding the url provided (tbeerbower)
Date Tue, 19 May 2015 14:07:09 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 27a228977 -> e3d5fd618


AMBARI-11229 - Views: AmbariStreamProvider is encoding the url provided (tbeerbower)


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

Branch: refs/heads/trunk
Commit: e3d5fd61864872121f994e769e8a7e4e496912c1
Parents: 27a2289
Author: tbeerbower <tbeerbower@hortonworks.com>
Authored: Tue May 19 10:06:51 2015 -0400
Committer: tbeerbower <tbeerbower@hortonworks.com>
Committed: Tue May 19 10:06:59 2015 -0400

----------------------------------------------------------------------
 .../server/controller/AmbariManagementControllerImpl.java | 10 +++++++++-
 .../controller/AmbariManagementControllerImplTest.java    |  3 +++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3d5fd61/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index d1aebae..266d299 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -323,7 +323,15 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     uriBuilder.setScheme(masterProtocol);
     uriBuilder.setHost(masterHostname);
     uriBuilder.setPort(masterPort);
-    uriBuilder.setPath(path);
+
+    String[] parts = path.split("\\?");
+
+    if (parts.length > 1) {
+      uriBuilder.setPath(parts[0]);
+      uriBuilder.setQuery(parts[1]);
+    } else {
+      uriBuilder.setPath(path);
+    }
 
     return uriBuilder.toString();
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3d5fd61/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
index 5d84586..23ce914 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
@@ -170,6 +170,9 @@ public class AmbariManagementControllerImplTest {
     ambariConfigsSetter.setConfigs(controller, "https", "othersecuredhost", 8443);
     assertEquals("https://othersecuredhost:8443/oracle/ojdbc/", controller.getAmbariServerURI("/oracle/ojdbc/"));
 
+    ambariConfigsSetter.setConfigs(controller, "http", "hostname", 8080);
+    assertEquals("http://hostname:8080/jdk_path?query", controller.getAmbariServerURI("/jdk_path?query"));
+
     verify(injector);
   }
 


Mime
View raw message