set_custom_http_headers = (res, req, state) => {
  const state1 = state || getState();
  const hdrs = state1.getConfig("custom_http_headers");
  if (!req.user) {
    const public_cache_maxage = +state1.getConfig("public_cache_maxage", 0);
    if (public_cache_maxage)
      res.header(
        "Cache-Control",
        `public, max-age=${public_cache_maxage * 60}`
      );
  }
  if (!hdrs) return;
  for (const ln of hdrs.split("\n")) {
    const [k, v] = ln.split(":");
    if (v && k && v.trim) {
      try {
        const val = v.trim();
        validateHeaderName(k);
        validateHeaderValue(k, val);
        res.header(k, val);
      } catch (e) {
        Crash.create(e, { url: "/", headers: {} });
      }
    }
  }
}
Sets Custom HTTP headers using data from "custom_http_headers" config variable
@param {object} res
@param {string} state
@returns {void}