code: protected String sanitizeContentTypes(String contentType) {
          if (StringUtils.isNullOrEmpty(contentType)) {
              return null;
          }
  
          StringBuilder sb = new StringBuilder();
          String[] types = contentType.split(",");
          for (String type : types) {
              if (type.contains(";")) {
                  // drop ;q=0.8 quality scores
                  type = type.substring(0, type.indexOf(';'));
              }
  
              sb.append(type).append(',');
          }
  
          // trim trailing comma
          sb.setLength(sb.length() - 1);
  
          return sb.toString();
      }
docs: Cleans a complex content-type or accept header value by removing the
  quality scores.
  <p/>
  <pre>
  text/html,application/xhtml+xml,application/xml;q=0.9,image/webp
  </pre>
  
  @param contentType
  @return null or the first matching content type engine