camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r774394 - in /camel/branches/camel-1.x: ./ components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
Date Wed, 13 May 2009 15:09:40 GMT
Author: ningjiang
Date: Wed May 13 15:09:39 2009
New Revision: 774394

URL: http://svn.apache.org/viewvc?rev=774394&view=rev
Log:
Merged revisions 774383 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r774383 | ningjiang | 2009-05-13 22:31:49 +0800 (Wed, 13 May 2009) | 1 line
  
  CAMEL-1609 fixed the issue of Content type for HTTP not being sent in header
........

Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
    camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 13 15:09:39 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383

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

Modified: camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java?rev=774394&r1=774393&r2=774394&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
(original)
+++ camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
Wed May 13 15:09:39 2009
@@ -29,8 +29,7 @@
     }
 
     protected void initialize() {
-        getOutFilter().add("content-length");
-        getOutFilter().add("content-type");        
+        getOutFilter().add("content-length");                
         getOutFilter().add(HttpMethods.HTTP_METHOD.toLowerCase());
         getOutFilter().add(HttpProducer.QUERY);
         getOutFilter().add(HttpProducer.HTTP_RESPONSE_CODE.toLowerCase());

Modified: camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java?rev=774394&r1=774393&r2=774394&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyContentTypeTest.java
Wed May 13 15:09:39 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