I'm using Quarkus 2.13
with Camel 3.18
. I have rest endpoint set, which is working as expected:
restConfiguration()
.component("platform-http")
.skipBindingOnErrorCode(false)
.bindingMode(RestBindingMode.json);
I did write ContainerResponseFilter
to modify headers of outgoing response, but response is not handle via this filter:
@JBossLog
@Provider
public class CustomContainerResponseFilter implements ContainerResponseFilter {
@Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
throws IOException {
responseContext.getHeaders().add("X-Some-Header", "Hello from Response Filter");
// I want to filter out disallowed-headers
}
}
Filter is working fine with standar controller, but when using Camel Endpoint with platform-http
, response is not handle via ContainerResponseFilter
.
@Path("/hello")
public class HelloController {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayHello() {
return "Hello, Quarkus!";
}
}
Update:
My goal is to filter out disallowed-headers
. For that I've create my list and just want to remove headers which are not on the list.