code: private void replaceHeaders(URLRewritingConfig config, HeaderMap headers) {
          for (Entry<String, String> entry : headers) {
              String key = entry.getKey();
              String value = entry.getValue();
              value = doHeaderReplaceAll(value, config.getFromRegex(), config.getToReplacement());
              if (value != null) {
                  headers.put(key, value);
              }
          }
      }
docs: Perform replacement.
  
  @param config
  @param headers