davsclaus commented on code in PR #23652:
URL: https://github.com/apache/camel/pull/23652#discussion_r3364266527
##########
core/camel-support/src/main/java/org/apache/camel/support/DefaultHeaderFilterStrategy.java:
##########
@@ -42,15 +42,16 @@
public class DefaultHeaderFilterStrategy implements HeaderFilterStrategy {
/**
- * A filter pattern that only accepts keys starting with <tt>Camel</tt>.
+ * A filter pattern that only accepts keys starting with <tt>Camel</tt> or
<tt>org.apache.camel</tt>.
*
* @deprecated use {@link #CAMEL_FILTER_STARTS_WITH}
*/
@Deprecated(since = "3.9.0")
- public static final Pattern CAMEL_FILTER_PATTERN =
Pattern.compile("(?i)Camel[.a-zA-z0-9]*");
+ public static final Pattern CAMEL_FILTER_PATTERN
+ = Pattern.compile("(?i)(Camel|org\\.apache\\.camel)[.a-zA-Z0-9]*");
Review Comment:
The `CAMEL_FILTER_PATTERN` regex was extended to match `org.apache.camel`,
and the `A-z` range was fixed to `A-Z` (the original accidentally included
`[\]^_\``). However, since `CAMEL_FILTER_PATTERN` is deprecated and no code in
the codebase references it as a filter pattern, these changes are dead code.
Consider leaving the deprecated constant unchanged to avoid confusion with
`CAMEL_FILTER_STARTS_WITH` (which correctly does **not** include
`org.apache.camel`).
##########
components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpProtocolHeaderFilterStrategy.java:
##########
@@ -27,6 +27,9 @@ public HttpProtocolHeaderFilterStrategy() {
// Just add the http headers here
protected void initialize() {
+ // This strategy filters HTTP protocol headers only; Camel-prefixed
headers must not be blocked
+ // so that they survive the request-to-response copy in
HttpProducer.copyHeaders.
Review Comment:
Only the inbound direction is opted out. The outbound direction now inherits
the default `CAMEL_FILTER_STARTS_WITH` from the field initializer. Since this
strategy is used for inbound protocol-header filtering in
`HttpProducer.copyHeaders()`, the outbound side likely doesn't matter in
practice — but the asymmetry could surprise future callers. Consider also
adding `setOutFilterStartsWith((String[]) null)` for symmetry, or a brief
comment explaining why only inbound is opted out.
--
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]