docs: static String parseContentType(String contentType) throws IOException {
          if (contentType.indexOf(System.getProperty("line.separator")) > 0) {
              BufferedReader reader = new BufferedReader(new StringReader(contentType));
  
              try {
                  String plainContentType = reader.readLine();
                  if (plainContentType != null && plainContentType.trim().endsWith(";")) {
                      plainContentType = plainContentType.trim().substring(0, plainContentType.length() - 1);
                  }
  
                  return plainContentType;
              } finally {
                  try {
                      reader.close();
                  } catch (IOException e) {
                      log.warn("Failed to close reader", e);
                  }
              }
          }
  
          return contentType;
      }