Author: ningjiang
Date: Tue Sep 27 11:17:54 2011
New Revision: 1176329

URL: http://svn.apache.org/viewvc?rev=1176329&view=rev
Log:
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.8.x/   (props changed)
    
camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
    
camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 27 11:17:54 2011
@@ -1 +1 @@
-/camel/trunk:1173732,1173958,1174047,1174129,1174245,1174565,1174626,1174745,1174817,1174837,1175139,1175313,1175321,1175437-1175438
+/camel/trunk:1173732,1173958,1174047,1174129,1174245,1174565,1174626,1174745,1174817,1174837,1175139,1175313,1175321,1175437-1175438,1176274

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java?rev=1176329&r1=1176328&r2=1176329&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
 (original)
+++ 
camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
 Tue Sep 27 11:17:54 2011
@@ -221,7 +221,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.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java?rev=1176329&r1=1176328&r2=1176329&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
 (original)
+++ 
camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
 Tue Sep 27 11:17:54 2011
@@ -337,8 +337,14 @@ public class HttpProducer extends Defaul
             throw new IllegalArgumentException("Invalid uri: " + uri
                     + ". If you are forwarding/bridging http endpoints, then 
enable the bridgeEndpoint option on the endpoint: " + getEndpoint());
         }
-
-        StringBuilder builder = new 
StringBuilder(uri.getScheme()).append("://").append(uri.getHost());
+        
+        // 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());
@@ -352,6 +358,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