servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tt...@apache.org
Subject svn commit: r568645 - /incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshaler.java
Date Wed, 22 Aug 2007 15:09:59 GMT
Author: tterm
Date: Wed Aug 22 08:09:59 2007
New Revision: 568645

URL: http://svn.apache.org/viewvc?rev=568645&view=rev
Log:
SM-1038 http provider endpoint sends wrong Host header

Modified:
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshaler.java

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshaler.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshaler.java?rev=568645&r1=568644&r2=568645&view=diff
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshaler.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshaler.java
Wed Aug 22 08:09:59 2007
@@ -18,6 +18,7 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.Reader;
+import java.net.URI;
 import java.util.Map;
 
 import javax.jbi.messaging.ExchangeStatus;
@@ -41,7 +42,7 @@
 
 /**
  * Default marshaler used for non-soap provider endpoints.
- * 
+ *
  * @author gnodet
  * @since 3.2
  */
@@ -160,11 +161,16 @@
         }
         return content;
     }
-    
-    public void createRequest(final MessageExchange exchange, 
-                              final NormalizedMessage inMsg, 
+
+    public void createRequest(final MessageExchange exchange,
+                              final NormalizedMessage inMsg,
                               final SmxHttpExchange httpExchange) throws Exception {
         httpExchange.setURL(getLocationUri(exchange, inMsg));
+
+        // Temporary fix for bug in jetty-client 6.1.5
+        // http://fisheye.codehaus.org/browse/jetty-contrib/jetty/trunk/contrib/client/src/main/java/org/mortbay/jetty/client/HttpConnection.java?r1=374&r2=378
+        httpExchange.addRequestHeader(HttpHeaders.HOST_BUFFER, new ByteArrayBuffer(new URI(getLocationUri(exchange,
inMsg)).getHost()));
+
         httpExchange.setMethod(getMethod(exchange, inMsg));
         httpExchange.setRequestHeader(HttpHeaders.CONTENT_TYPE, getContentType(exchange,
inMsg));
         if (getHeaders() != null) {
@@ -207,5 +213,5 @@
 
         }
     }
-    
+
 }



Mime
View raw message