[
https://issues.apache.org/jira/browse/CAMEL-26470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-26470.
---------------------------------
Resolution: Fixed
Fixed by https://github.com/apache/camel/pull/28814, merged to main as
cc1217629ee1fb402036c96bef7afb87eef8b77d.
_Claude Code on behalf of davsclaus_
> camel-support - PatternHelper: do not compile a regular expression for a
> pattern without metacharacters
> -------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-26470
> URL: https://issues.apache.org/jira/browse/CAMEL-26470
> Project: Camel
> Issue Type: Sub-task
> Reporter: Adriano Machado
> Assignee: Adriano Machado
> Priority: Major
> Fix For: 4.24.0
>
>
> Tier 2 item of CAMEL-25132. PatternHelper.matchPattern compiles a regular
> expression for every name that is not an exact or wildcard match, so
> {{removeHeaders("Camel*")}}, which the security checklist recommends,
> compiles one per remaining header on every exchange. The ticket measured
> about 930 ns and 7.6 KB per exchange with 12 headers.
> A pattern without regex metacharacters cannot match anything beyond the exact
> and wildcard checks, except that a trailing {{*}} also means zero or more of
> the previous character, so {{Camel*}} matches the name {{Came}}. Such
> patterns can skip the compile unless the name has exactly that shape. Other
> patterns still compile, and the matching result must not change.
> _Claude Code on behalf of Adriano Machado (@ammachado)_
> _This was generated by an AI agent and may contain inaccuracies. Please
> verify before relying on it._
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)