class HeaderUpdateInterceptor implements RequestInterceptor, ResponseInterceptor {

    @Override
    public void onResponseReceive(final WilmaHttpResponse response, final ParameterList parameters) {
        if (parameters != null && !parameters.isEmpty()) {
            List<Parameter> parameterList = parameters.getAllParameters();
            for (Parameter parameter : parameterList) {
                String name = parameter.getName();
                String value = parameter.getValue();
                if (REMOVE_HEADER.equals(name.toUpperCase())) {
                    // remove header
                    response.addHeaderRemove(value);
                } else {
                    response.addHeaderUpdate(name, value);
                }
            }
        }
    }

}