mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-2598 - additional fix
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@985154 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
72278d5e0f
commit
e32c1ba9f8
|
@ -125,7 +125,7 @@ public class URISupport {
|
|||
}
|
||||
|
||||
public static Map<String, String> parseParameters(URI uri) throws URISyntaxException {
|
||||
if (uri.getQuery() != null) {
|
||||
if (!isCompositeURI(uri)) {
|
||||
return uri.getQuery() == null ? emptyMap() : parseQuery(stripPrefix(uri.getQuery(), "?"));
|
||||
} else {
|
||||
CompositeData data = URISupport.parseComposite(uri);
|
||||
|
@ -188,12 +188,28 @@ public class URISupport {
|
|||
CompositeData rc = new CompositeData();
|
||||
rc.scheme = uri.getScheme();
|
||||
String ssp = stripPrefix(uri.getRawSchemeSpecificPart().trim(), "//").trim();
|
||||
|
||||
|
||||
parseComposite(uri, rc, ssp);
|
||||
|
||||
rc.fragment = uri.getFragment();
|
||||
return rc;
|
||||
}
|
||||
|
||||
public static boolean isCompositeURI(URI uri) {
|
||||
if (uri.getQuery() != null) {
|
||||
return false;
|
||||
} else {
|
||||
String ssp = stripPrefix(uri.getRawSchemeSpecificPart().trim(), "(").trim();
|
||||
ssp = stripPrefix(ssp, "//").trim();
|
||||
try {
|
||||
new URI(ssp);
|
||||
} catch (URISyntaxException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
|
|
|
@ -109,6 +109,8 @@ public class URISupportTest extends TestCase {
|
|||
uri = new URI("static://http://localhost:61617?proxyHost=localhost&proxyPort=80");
|
||||
parameters = URISupport.parseParameters(uri);
|
||||
verifyParams(parameters);
|
||||
uri = new URI("http://0.0.0.0:61616");
|
||||
parameters = URISupport.parseParameters(uri);
|
||||
}
|
||||
|
||||
private void verifyParams(Map<String,String> parameters) {
|
||||
|
|
Loading…
Reference in New Issue