camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r774383 - in /camel/trunk/components: camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
Date Wed, 13 May 2009 14:31:49 GMT
Author: ningjiang
Date: Wed May 13 14:31:49 2009
New Revision: 774383

URL: http://svn.apache.org/viewvc?rev=774383&view=rev
Log:
CAMEL-1609 fixed the issue of Content type for HTTP not being sent in header

Modified:
    camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
    camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java

Modified: camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java?rev=774383&r1=774382&r2=774383&view=diff
==============================================================================
--- camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
(original)
+++ camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
Wed May 13 14:31:49 2009
@@ -28,8 +28,7 @@
     }
 
     protected void initialize() {
-        getOutFilter().add("content-length");
-        getOutFilter().add("content-type");        
+        getOutFilter().add("content-length");                
         getOutFilter().add(HttpConstants.HTTP_METHOD.toLowerCase());
         getOutFilter().add(HttpConstants.HTTP_QUERY);
         getOutFilter().add(HttpConstants.HTTP_RESPONSE_CODE.toLowerCase());

Modified: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java?rev=774383&r1=774382&r2=774383&view=diff
==============================================================================
--- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
(original)
+++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
Wed May 13 14:31:49 2009
@@ -32,7 +32,7 @@
         Exchange exchange = endpoint.createExchange();
         exchange.getIn().setBody("<order>123</order>");
         exchange.getIn().setHeader("user", "Claus");
-        exchange.getIn().setHeader("content-type", "text/xml");
+        exchange.getIn().setHeader("Content-Type", "text/xml");
         if (usingGZip) {
             GZIPHelper.setGZIPMessageHeader(exchange.getIn());
         }
@@ -40,7 +40,7 @@
 
         String body = exchange.getOut().getBody(String.class);
         assertEquals("<order>OK</order>", body);
-        assertOutMessageHeader(exchange, "content-type", "text/xml");
+        assertOutMessageHeader(exchange, "Content-Type", "text/xml");
     }
 
     public void testSameContentType() throws Exception {
@@ -74,8 +74,11 @@
 
     public class MyBookService implements Processor {
         public void process(Exchange exchange) throws Exception {
-            if (exchange.getIn().getHeader("user") != null && exchange.getIn().getBody(String.class).equals("<order>123</order>"))
{
-                exchange.getOut().setBody("<order>OK</order>");             
  
+            if (exchange.getIn().getHeader("user") != null 
+                && exchange.getIn().getBody(String.class).equals("<order>123</order>")
+                && exchange.getIn().getHeader("Content-Type").equals("text/xml"))
{
+                exchange.getOut().setBody("<order>OK</order>");
+                exchange.getOut().setHeader("Content-Type", "text/xml");
             } else {
                 exchange.getOut().setBody("FAIL");
                 exchange.getOut().setHeader("Content-Type", "text/plain");



Mime
View raw message