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/1cfa6b67 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1cfa6b67 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1cfa6b67 Branch: refs/heads/camel-2.12.x Commit: 1cfa6b67e5e0edd376ed3fe6387e4b166a626b19 Parents: 74707f7 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:38:39 2014 +0800 ---------------------------------------------------------------------- .../cxf/jaxrs/CxfRsHeaderFilterStrategy.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/1cfa6b67/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]*"); }