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

   ## Backport of #24406
   
   Cherry-pick of #24406 onto `camel-4.14.x` (targeting the 4.14.9 release).
   
   **Original PR:** #24406 — CAMEL-23891: camel-mail - filter Camel internal 
headers in MimeMultipartDataFormat unmarshal
   **Original author:** @oscerd
   **Target branch:** `camel-4.14.x`
   
   ### What changed
   
   `MimeMultipartDataFormat` unmarshalling (`headersInline=true`) now aligns 
with the camel-mail consumer: internal Camel headers (`Camel*`, matched 
case-insensitively) present in the external MIME headers are no longer copied 
verbatim onto the Camel message. Ordinary application headers (e.g. `X-...`) 
continue to pass through unchanged, via 
`DefaultHeaderFilterStrategy.applyFilterToExternalHeaders(...)` on the inbound 
path — consistent with the `MailHeaderFilterStrategy` already applied by the 
consumer.
   
   ### Backport notes
   
   - **Hand-ported** (not a verbatim cherry-pick): on `camel-4.14.x` the 
inbound header copy is still **inline** inside `unmarshal()` and uses the 
pre-pattern-matching `if (ho instanceof Header) { Header header = (Header) ho; 
... }` form. The same filter guard (`applyFilterToExternalHeaders(...) → 
continue` before `setHeader`) was applied to that structure.
   - **`Camel*` in-filter configured explicitly**: 
`DefaultHeaderFilterStrategy` on `camel-4.14.x` does **not** enable the 
`Camel*` in-filter by default — that default was introduced later on 
`main`/`camel-4.21.x` by CAMEL-23543 (`c2ce0267`), which is not on this branch. 
The data format therefore configures 
`setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH)` on its strategy so filtering 
behaves identically to #24406. Verified by running 
`MimeMultipartDataFormatTest` (22 pass).
   - The unit test (`unmarshalInlineHeadersFiltersCamelInternalHeaders`) is 
cherry-picked verbatim and applies cleanly.
   - The upgrade-guide entry is intentionally **not** included here: per 
project policy the upgrade-guide history is canonical on `main` (the 4.14-line 
note is handled as a separate doc-sync on `main`).
   
   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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to