Andrea Cosentino created CAMEL-24424:
----------------------------------------
Summary: camel-vertx-http - REST header filter strategy applies
the inbound rules on the outbound direction
Key: CAMEL-24424
URL: https://issues.apache.org/jira/browse/CAMEL-24424
Project: Camel
Issue Type: Bug
Components: camel-vertx-http
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
Fix For: 4.23.0
VertxHttpRestHeaderFilterStrategy.applyFilterToCamelHeaders() delegates to the
wrong super method:
{code:java}
@Override
public boolean applyFilterToCamelHeaders(String headerName, Object headerValue,
Exchange exchange) {
boolean answer = super.applyFilterToExternalHeaders(headerName,
headerValue, exchange);
return filterCheck(templateUri, queryParameters, headerName, answer);
}
{code}
It calls applyFilterToExternalHeaders (the inbound rules) while implementing
applyFilterToCamelHeaders (the outbound direction), so the out-filter
configured on the strategy never applies. The sibling REST strategies in
camel-netty-http, camel-undertow and camel-http-common all call the matching
super method.
Proposal: call super.applyFilterToCamelHeaders(...), and add a test asserting
that a header excluded on the outbound direction does not reach the wire.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)