You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/09/26 07:26:51 UTC

[camel] branch camel-2.21.x updated: Camel-restlet: use equals in the method comparison for POST and PUT, more OSGI-friendly

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.21.x by this push:
     new 42c8023  Camel-restlet: use equals in the method comparison for POST and PUT, more OSGI-friendly
42c8023 is described below

commit 42c802336f85b9e32441be9584e68a9d62836c4d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Sep 26 09:18:57 2018 +0200

    Camel-restlet: use equals in the method comparison for POST and PUT, more OSGI-friendly
---
 .../java/org/apache/camel/component/restlet/DefaultRestletBinding.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
index 2ac0d5e..8508590 100644
--- a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
+++ b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
@@ -288,7 +288,7 @@ public class DefaultRestletBinding implements RestletBinding, HeaderFilterStrate
             LOG.debug("Populate Restlet {} request from exchange body as form using media type {}", method, mediaType);
         } else {
             // include body if PUT or POST
-            if (request.getMethod() == Method.PUT || request.getMethod() == Method.POST) {
+            if (request.getMethod().equals(Method.PUT) || request.getMethod().equals(Method.POST)) {
                 Representation body = createRepresentationFromBody(exchange, mediaType);
                 request.setEntity(body);
                 LOG.debug("Populate Restlet {} request from exchange body: {} using media type {}", method, body, mediaType);