Author: ningjiang
Date: Tue Sep 27 11:53:59 2011
New Revision: 1176341

URL: http://svn.apache.org/viewvc?rev=1176341&view=rev
Log:
Merged revisions 1176329 via svnmerge from 
https://svn.apache.org/repos/asf/camel/branches/camel-2.8.x

................
  r1176329 | ningjiang | 2011-09-27 19:17:54 +0800 (Tue, 27 Sep 2011) | 9 lines
  
  Merged revisions 1176274 via svnmerge from 
  https://svn.apache.org/repos/asf/camel/trunk
  
  ........
    r1176274 | ningjiang | 2011-09-27 16:32:54 +0800 (Tue, 27 Sep 2011) | 1 line
    
    CAMEL-4489 Fixed the http4 url issue when using the proxy
  ........
................

Modified:
    camel/branches/camel-2.7.x/   (props changed)
    
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
    
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 27 11:53:59 2011
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.8.x:1174571,1175323
-/camel/trunk:1146608,1146903,1147216,1174565,1175321
+/camel/branches/camel-2.8.x:1174571,1175323,1176329
+/camel/trunk:1146608,1146903,1147216,1174565,1175321,1176274

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Sep 27 11:53:59 2011
@@ -1 +1 @@
-/camel/branches/camel-2.8.x:1-1146127,1146608,1146653,1146771,1146903,1147216,1174571,1175323
+/camel/branches/camel-2.8.x:1-1146127,1146608,1146653,1146771,1146903,1147216,1174571,1175323,1176329

Modified: 
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java?rev=1176341&r1=1176340&r2=1176341&view=diff
==============================================================================
--- 
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
 (original)
+++ 
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
 Tue Sep 27 11:53:59 2011
@@ -219,7 +219,7 @@ public class HttpEndpoint extends Defaul
 
     public int getPort() {
         if (httpUri.getPort() == -1) {
-            if ("https".equals(getProtocol())) {
+            if ("https".equals(getProtocol()) || 
"https4".equals(getProtocol())) {
                 return 443;
             } else {
                 return 80;

Modified: 
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java?rev=1176341&r1=1176340&r2=1176341&view=diff
==============================================================================
--- 
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
 (original)
+++ 
camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
 Tue Sep 27 11:53:59 2011
@@ -245,7 +245,7 @@ public class HttpProducer extends Defaul
         if (contentType != null && 
contentType.equals(HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT)) {
             return HttpHelper.deserializeJavaObjectFromStream(response);
         } else {
-            return response;
+                                   return response;
         }
     }
 
@@ -284,7 +284,18 @@ public class HttpProducer extends Defaul
             queryString = getEndpoint().getHttpUri().getRawQuery();
         }
 
-        StringBuilder builder = new 
StringBuilder(uri.getScheme()).append("://").append(uri.getHost());
+        if (uri.getScheme() == null || uri.getHost() == null) {
+            throw new IllegalArgumentException("Invalid uri: " + uri
+                    + ". If you are forwarding/bridging http endpoints, then 
enable the bridgeEndpoint option on the endpoint: " + getEndpoint());
+        }
+        
+        // Changed the schema to http4 to normal http by default
+        String schema = "http";
+        if (uri.getScheme().equals("https4")) {
+            schema = "https";
+        }
+        
+        StringBuilder builder = new 
StringBuilder(schema).append("://").append(uri.getHost());
 
         if (uri.getPort() != -1) {
             builder.append(":").append(uri.getPort());
@@ -298,6 +309,9 @@ public class HttpProducer extends Defaul
             builder.append('?');
             builder.append(queryString);
         }
+        
+        LOG.debug(" The uri used by http request is " + builder.toString());
+       
 
         HttpRequestBase httpRequest = 
methodToUse.createMethod(builder.toString());
 


Reply via email to