AMQ-4058: http transport should not use uri parameters for remote url.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1386573 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Claus Ibsen 2012-09-17 12:04:47 +00:00
parent 3b4aadca7b
commit 6cc5f40bf7
2 changed files with 21 additions and 2 deletions

View File

@ -17,6 +17,7 @@
package org.apache.activemq.transport.http; package org.apache.activemq.transport.http;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.HashMap; import java.util.HashMap;
@ -66,7 +67,16 @@ public class HttpTransportFactory extends TransportFactory {
protected Transport createTransport(URI location, WireFormat wf) throws IOException { protected Transport createTransport(URI location, WireFormat wf) throws IOException {
TextWireFormat textWireFormat = asTextWireFormat(wf); TextWireFormat textWireFormat = asTextWireFormat(wf);
return new HttpClientTransport(textWireFormat, location); // need to remove options from uri
URI uri;
try {
uri = URISupport.removeQuery(location);
} catch (URISyntaxException e) {
MalformedURLException cause = new MalformedURLException("Error removing query on " + location);
cause.initCause(e);
throw cause;
}
return new HttpClientTransport(textWireFormat, uri);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")

View File

@ -54,6 +54,15 @@ public class HttpsTransportFactory extends HttpTransportFactory {
} }
protected Transport createTransport(URI location, WireFormat wf) throws MalformedURLException { protected Transport createTransport(URI location, WireFormat wf) throws MalformedURLException {
return new HttpsClientTransport(asTextWireFormat(wf), location); // need to remove options from uri
URI uri;
try {
uri = URISupport.removeQuery(location);
} catch (URISyntaxException e) {
MalformedURLException cause = new MalformedURLException("Error removing query on " + location);
cause.initCause(e);
throw cause;
}
return new HttpsClientTransport(asTextWireFormat(wf), uri);
} }
} }