CAMEL-7457 polish the code with the suggestion of Clause
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1dc30318 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1dc30318 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1dc30318 Branch: refs/heads/camel-2.13.x Commit: 1dc303183b7a05b426dadf7cc1b6c916c96ec471 Parents: 09bdee8 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Mon May 26 14:31:57 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Mon May 26 15:24:18 2014 +0800 ---------------------------------------------------------------------- .../cxf/jaxrs/CxfRsHeaderFilterStrategy.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/1dc30318/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsHeaderFilterStrategy.java ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsHeaderFilterStrategy.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsHeaderFilterStrategy.java index 4972d99..bf73a3f 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsHeaderFilterStrategy.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsHeaderFilterStrategy.java @@ -31,16 +31,15 @@ public class CxfRsHeaderFilterStrategy extends DefaultHeaderFilterStrategy { } protected void initialize() { - getOutFilter().add(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS); - getOutFilter().add(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API); - getOutFilter().add(CxfConstants.CAMEL_CXF_RS_OPERATION_RESOURCE_INFO_STACK); - getOutFilter().add(CxfConstants.CAMEL_CXF_RS_VAR_VALUES); - getOutFilter().add(CxfConstants.OPERATION_NAME); - getOutFilter().add(Exchange.HTTP_METHOD); - getOutFilter().add(Exchange.HTTP_PATH); - getOutFilter().add(Exchange.DESTINATION_OVERRIDE_URL); + + getOutFilter().add(CxfConstants.OPERATION_NAME.toLowerCase()); + + getOutFilter().add("Content-Type".toLowerCase()); + // Support to filter the Content-Type case insensitive + setLowerCase(true); + // filter headers begin with "Camel" or "org.apache.camel" - setOutFilterPattern("((Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*)|(?i)Content-Type"); + setOutFilterPattern("(Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*"); }