You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/07/06 09:20:54 UTC

[PR] CAMEL-23891: camel-mail - configure Camel* in-filter explicitly in MimeMultipartDataFormat (4.18.x follow-up to #24409) [camel]

oscerd opened a new pull request, #24454:
URL: https://github.com/apache/camel/pull/24454

   ## Follow-up to #24409 — makes the CAMEL-23891 fix actually filter on `camel-4.18.x`
   
   The 4.18.x backport #24409 (merged) is a **silent no-op**: it instantiated `new DefaultHeaderFilterStrategy()` and relied on it filtering the `Camel*` namespace **by default**. That default only exists since **CAMEL-23543** (`c2ce0267`, "Centralize and harden Camel* header filtering in DefaultHeaderFilterStrategy"), which is on `main` and `camel-4.21.x` **only** — it is **not** on `camel-4.18.x`. On this branch `inFilterStartsWith` is `null` by default, so `applyFilterToExternalHeaders(...)` returns `false` for every header and `Camel*` headers from inline MIME content were still copied onto the Camel message.
   
   ### Change
   
   Configure the in-filter explicitly on the data format's strategy:
   
   ```java
   private final HeaderFilterStrategy headerFilterStrategy = createInboundHeaderFilterStrategy();
   
   private static HeaderFilterStrategy createInboundHeaderFilterStrategy() {
       DefaultHeaderFilterStrategy strategy = new DefaultHeaderFilterStrategy();
       strategy.setInFilterStartsWith(DefaultHeaderFilterStrategy.CAMEL_FILTER_STARTS_WITH); // {"Camel","camel"}
       return strategy;
   }
   ```
   
   This is the same approach already merged on the `camel-4.14.x` backport (#24445). Case-insensitive matching (e.g. `CAMELBaz`) works because `lowerCase=true` and `filterOnMatch=true` are the defaults on this branch.
   
   ### Validation
   
   - `MimeMultipartDataFormatTest` — **22 pass** (the `unmarshalInlineHeadersFiltersCamelInternalHeaders` case failed `expected <null> but was <blocked>` before this change, passes after).
   - Full reactor `mvn clean install -DskipTests` — BUILD SUCCESS.
   
   No upgrade-guide change (guide history is canonical on `main` per project policy).
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-23891
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code) on behalf of Andrea Cosentino


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23891: camel-mail - configure Camel* in-filter explicitly in MimeMultipartDataFormat (4.18.x follow-up to #24409) [camel]

Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd merged PR #24454:
URL: https://github.com/apache/camel/pull/24454


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org