private void setHeadersRequest(ApiRequest request, SimpleHeaderPolicyDefBean config, ApplyTo applyTo) {
        HeaderMap headers = request.getHeaders();
        for (AddHeaderBean header : config.getAddHeaders()) {
            if ((header.getApplyTo() == applyTo || header.getApplyTo() == ApplyTo.BOTH)) {
                if (header.getOverwrite() || !headers.containsKey(header.getHeaderName())) {
                    headers.put(header.getHeaderName(), header.getResolvedHeaderValue(request));
                }
            }
        }
    }
Set, overwrite and/or delete headers on request, response or both, with pattern matching available.

@author Marc Savy {@literal <msavy@redhat.com>}
plugins/simple-header-policy/src/main/java/io/apiman/plugins/simpleheaderpolicy/SimpleHeaderPolicy.java