return Boolean.valueOf(System.getProperty(CACHE_HEADERS_SYSTEM_PROPERTY, "true"));
}
private void addHeadersToRequest(SubmitContext context, AbstractHttpRequest<?> request) {
// get existing and save
StringToStringsMap headers = request.getRequestHeaders();
savedHeaders.put(request, createCopyOfHeaders(headers));
boolean replaceHeaders = isReplaceHeaders();
for (String name : headersToAdd.keySet()) {
// remove existing if replace is enabled
if (replaceHeaders && headers.containsKey(name))
headers.get(name).clear();
// add header values
for (String value : headersToAdd.get(name)) {
headers.add(name, PropertyExpander.expandProperties(context, value));
}
}
request.setRequestHeaders(headers);
}