svn commit: r701582 - in /activemq/camel/trunk/components: camel-http/src/main/java/org/apache/camel/component/http/HttpMessage.java camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r701582 - in /activemq/camel/trunk/components: camel-http/src/main/java/org/apache/camel/component/http/HttpMessage.java camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java

ningjiang
Author: ningjiang
Date: Fri Oct  3 19:02:19 2008
New Revision: 701582

URL: http://svn.apache.org/viewvc?rev=701582&view=rev
Log:
CAMEL-877 only set the parameters into the header when the request is GET

Modified:
    activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMessage.java
    activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java

Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMessage.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMessage.java?rev=701582&r1=701581&r2=701582&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMessage.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMessage.java Fri Oct  3 19:02:19 2008
@@ -68,12 +68,14 @@
             map.put(name, value);
         }
 
-        // also populate the http request parameters
-        names = request.getParameterNames();
-        while (names.hasMoreElements()) {
-            String name = (String)names.nextElement();
-            Object value = request.getParameter(name);
-            map.put(name, value);
+        //if the request method is Get, we also populate the http request parameters
+        if (request.getMethod().equalsIgnoreCase("GET")) {
+            names = request.getParameterNames();
+            while (names.hasMoreElements()) {
+                String name = (String)names.nextElement();
+                Object value = request.getParameter(name);
+                map.put(name, value);
+            }
         }
 
         // store the method and query as well

Modified: activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java?rev=701582&r1=701581&r2=701582&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java (original)
+++ activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java Fri Oct  3 19:02:19 2008
@@ -32,7 +32,7 @@
         mock.expectedBodiesReceived("<html><body>foo</body></html>");
         mock.expectedHeaderReceived("x", "foo");
 
-        template.sendBody(serverUri + "?x=foo", "Hello World");
+        template.sendBody(serverUri + "?x=foo", null);
 
         assertMockEndpointsSatisfied();
     }