function getContentType(msg) {
  const type = msg.contentType || '';
  const len = type.length;
  let i = 0;
  let c;
  // Cutting everything after , or ; or whitespace
  while (i < len && (c = type[i]) !== ',' && c !== ';' && c > ' ') {
    i += 1;
  }
  return type::slice(0, i);
}
Not using RegExp because it internally depends on proto stuff that can be easily broken,
and safe-guarding all of it is ridiculously disproportional.
@param {GMReq.Message.BG} msg