code: public CmsSite matchRequest(HttpServletRequest req) {
  
          CmsSiteMatcher matcher = getRequestMatcher(req);
          if (matcher.getTimeOffset() != 0) {
              HttpSession session = req.getSession();
              if (session != null) {
                  session.setAttribute(
                      CmsContextInfo.ATTRIBUTE_REQUEST_TIME,
                      new Long(System.currentTimeMillis() + matcher.getTimeOffset()));
              }
          }
          CmsSite site = matchSite(matcher);
  
          if (LOG.isDebugEnabled()) {
              String requestServer = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort();
              LOG.debug(
                  Messages.get().getBundle().key(
                      Messages.LOG_MATCHING_REQUEST_TO_SITE_2,
                      requestServer,
                      site.toString()));
          }
          return site;
      }
docs: Matches the given request against all configures sites and returns
  the matching site, or the default site if no sites matches.<p>
  
  @param req the request to match
  
  @return the matching site, or the default site if no sites matches