activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1386573 - in /activemq/trunk/activemq-optional: ./ src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java src/main/java/org/apache/activemq/transport/https/HttpsTransportFactory.java
Date Mon, 17 Sep 2012 12:04:48 GMT
Author: davsclaus
Date: Mon Sep 17 12:04:47 2012
New Revision: 1386573

URL: http://svn.apache.org/viewvc?rev=1386573&view=rev
Log:
AMQ-4058: http transport should not use uri parameters for remote url.

Modified:
    activemq/trunk/activemq-optional/   (props changed)
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransportFactory.java

Propchange: activemq/trunk/activemq-optional/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Sep 17 12:04:47 2012
@@ -10,3 +10,4 @@ surefire-classloader.properties
 surefire.properties
 eclipse-classes
 activemq-data
+.idea

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java?rev=1386573&r1=1386572&r2=1386573&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java
(original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java
Mon Sep 17 12:04:47 2012
@@ -17,6 +17,7 @@
 package org.apache.activemq.transport.http;
 
 import java.io.IOException;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.HashMap;
@@ -66,7 +67,16 @@ public class HttpTransportFactory extend
 
     protected Transport createTransport(URI location, WireFormat wf) throws IOException {
         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")

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransportFactory.java?rev=1386573&r1=1386572&r2=1386573&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransportFactory.java
(original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransportFactory.java
Mon Sep 17 12:04:47 2012
@@ -54,6 +54,15 @@ public class HttpsTransportFactory exten
     }
 
     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);
     }
 }



Mime
View raw message