docs: protected CORSRequestType checkRequestType(final HttpServletRequest request) {
          CORSRequestType requestType = CORSRequestType.INVALID_CORS;
          if (request == null) {
              throw new IllegalArgumentException("Request is null");
          }
          String originHeader = request.getHeader(REQUEST_HEADER_ORIGIN);
          // Section 6.1.1 and Section 6.2.1
          if (originHeader != null) {
              if (originHeader.isEmpty()) {
                  requestType = CORSRequestType.INVALID_CORS;
              } else if (!isValidOrigin(originHeader)) {
                  requestType = CORSRequestType.INVALID_CORS;
              } else if (isLocalOrigin(request, originHeader)) {
                  return CORSRequestType.NOT_CORS;
              } else {
                  String method = request.getMethod();
                  if (method != null) {
                      if ("OPTIONS".equals(method)) {
                          String accessControlRequestMethodHeader =
                                  request.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
                          if (accessControlRequestMethodHeader != null
                                  && !accessControlRequestMethodHeader.isEmpty()) {
                              requestType = CORSRequestType.PRE_FLIGHT;
                          } else if (accessControlRequestMethodHeader != null
                                  && accessControlRequestMethodHeader.isEmpty()) {
                              requestType = CORSRequestType.INVALID_CORS;
                          } else {
                              requestType = CORSRequestType.ACTUAL;
                          }
                      } else if ("GET".equals(method) || "HEAD".equals(method)) {
                          requestType = CORSRequestType.SIMPLE;
                      } else if ("POST".equals(method)) {
                          String mediaType = getMediaType(request.getContentType());
                          if (mediaType != null) {
                              if (SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES.contains(mediaType)) {
                                  requestType = CORSRequestType.SIMPLE;
                              } else {
                                  requestType = CORSRequestType.ACTUAL;
                              }
                          } else {
                              requestType = CORSRequestType.ACTUAL;
                          }
                      } else {
                          requestType = CORSRequestType.ACTUAL;
                      }
                  }
              }
          } else {
              requestType = CORSRequestType.NOT_CORS;
          }
  
          return requestType;
      }