I'm trying to add custom HTTP header to response in Apache CXF. I need to count MD5 from content and add it as a HTTP header. I tried to use ResponseHandler or Interceptor. My last try was
@Component
public class ResponseBPAuthFilter extends AbstractOutDatabindingInterceptor {
public ResponseBPAuthFilter() {
super(Phase.MARSHAL_ENDING);
}
@Override
public void handleMessage(Message t) throws Fault {
Map headers = CastUtils.cast((Map)t.get(Message.PROTOCOL_HEADERS));
headers.put("Some-Header", Arrays.asList("test"));
}
}
but it does nothing.