CAMEL-9664: Fixed mediatype matching to use equals method and ignore parameters.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c272e40b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c272e40b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c272e40b Branch: refs/heads/camel-2.16.x Commit: c272e40bccc6b424983140b8dad39adb0df9b53f Parents: 5cd27e2 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Mar 4 15:10:23 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Mar 4 15:10:43 2016 +0100 ---------------------------------------------------------------------- .../apache/camel/component/restlet/DefaultRestletBinding.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/c272e40b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java ---------------------------------------------------------------------- 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 a106104..80ddd4c 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 @@ -119,7 +119,7 @@ public class DefaultRestletBinding implements RestletBinding, HeaderFilterStrate } // only deal with the form if the content type is "application/x-www-form-urlencoded" - if (request.getEntity().getMediaType() != null && request.getEntity().getMediaType().equals(MediaType.APPLICATION_WWW_FORM)) { + if (request.getEntity().getMediaType() != null && request.getEntity().getMediaType().equals(MediaType.APPLICATION_WWW_FORM, true)) { Form form = new Form(request.getEntity()); for (String paramName : form.getValuesMap().keySet()) { String[] values = form.getValuesArray(paramName); @@ -161,7 +161,7 @@ public class DefaultRestletBinding implements RestletBinding, HeaderFilterStrate Form form = null; // Use forms only for PUT, POST and x-www-form-urlencoded - if ((Method.PUT == method || Method.POST == method) && mediaType == MediaType.APPLICATION_WWW_FORM) { + if ((Method.PUT == method || Method.POST == method) && MediaType.APPLICATION_WWW_FORM.equals(mediaType, true)) { form = new Form(); // must use string based for forms String body = exchange.getIn().getBody(String.class);