Handles the if-match header. returns true if the request should proceed, false otherwise

@param ifMatch The if match header
@param etag   The etags
@return
172852
public static boolean handleIfMatch(final String ifMatch, final ETag etag, boolean allowWeak) {
        return handleIfMatch(ifMatch, Collections.singletonList(etag), allowWeak);
    }
1279310
public boolean isMatching(CmsSiteMatcher matcher) {

        boolean result = m_siteMatcherSites.get(matcher) != null;
        if (!result) {
            // try to match the workplace site
            result = isWorkplaceRequest(matcher);
        }
        return result;
    }
1327308
boolean matchCDATASection(
            final boolean blockMatching,
            final int markupLevel, final int markupBlockIndex) {

        checkMarkupLevel(markupLevel);

        if (this.markupSelectorItem.anyLevel() || markupLevel == 0 || (this.prev != null && this.prev.matchedMarkupLevels[markupLevel - 1])) {
            // This text has not matched yet, but might match, so we should check

            this.matchesThisLevel = this.markupSelectorItem.matchesCDATASection(markupBlockIndex, this.markupBlockMatchingCounter);

            if (matchesPreviousOrCurrentLevel(markupLevel)) {
                // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

                if (this.next != null) {
                    return this.next.matchCDATASection(blockMatching, markupLevel, markupBlockIndex);
                }
                return (blockMatching? true : this.matchesThisLevel);

            } else if (this.matchesThisLevel) {
                // This filter was not matched before. So the fact that it matches now means we need to consume it,
                // therefore not delegating.

                return (this.next == null);

            }

        } else if (matchesPreviousOrCurrentLevel(markupLevel)) {
            // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

            if (this.next != null) {
                return this.next.matchCDATASection(blockMatching, markupLevel, markupBlockIndex);
            }
            return blockMatching;

        }

        return false;

    }
596310
private int matchNextHeader(int i, String key)
  {
    int size = _headerSize;
    int length = key.length();

    char []keyBuf = _headerBuffer;
    char []toLowerAscii = _toLowerAscii;

    for (; i < size; i++) {
      CharSegment header = _headerKeys[i];

      if (header.length() != length)
        continue;

      int offset = header.offset();

      int j;
      for (j = 0; j < length; j++) {
        char a = key.charAt(j);
        char b = keyBuf[offset + j];
        
        if (a == b) {
          continue;
        }
        else if (toLowerAscii[a] != toLowerAscii[b]) {
          break;
        }
      }

      if (j == length) {
        return i;
      }
    }

    return -1;
  }
546805
private function checkEtag(ResponseInterface $response)
    {
        $eTag = $response->getHeaderLine('ETag');
        $fullURL = Controller::join_links(Director::absoluteBaseURL(), $this->url);

        if ($eTag) {
            $this->result->addMessage(
                "$fullURL includes an Etag header in response",
                ValidationResult::TYPE_GOOD
            );
            return;
        }
        $this->result->addError(
            "$fullURL is missing an Etag header",
            ValidationResult::TYPE_WARNING
        );
    }
394748
def etag(self, etag):
        
        if etag is None:
            raise ValueError("Invalid value for `etag`, must not be `None`")
        if etag is not None and not re.search('[A-Za-z0-9]{0,256}', etag):
            raise ValueError("Invalid value for `etag`, must be a follow pattern or equal to `/[A-Za-z0-9]{0,256}/`")

        self._etag = etag
307695
public static boolean isMatch(String match, Object paramObj) {
        return StringHelper.isBlank(match) || isTrue(match, paramObj);
    }
1214640
@GwtIncompatible("java.util.regex.Pattern")
  public void matches(Pattern regex) {
    if (!regex.matcher(actual()).matches()) {
      failWithActual("expected to match", regex);
    }
  }
1134434
public PactDslRequestWithPath matchHeader(String header, String regex, String headerExample) {
        requestMatchers.addCategory("header").setRule(header, new RegexMatcher(regex));
        requestHeaders.put(header, Collections.singletonList(headerExample));
        return this;
    }
1087695
public boolean isFilterMatch(BaseMessageHeader messageHeader)
    {
        boolean bMatch = super.isFilterMatch(messageHeader);
        if (bMatch)
        {
            if (m_bPrivate)
                bMatch = false; // Only a matching SessionMessageHeader will be sent.
            if ((messageHeader != null)
                && (this.getObjectKey() != null)
                && (messageHeader instanceof SessionMessageHeader)
                && (((SessionMessageHeader)messageHeader).getObjectKey() != null)
                && (!this.getObjectKey().equals(((SessionMessageHeader)messageHeader).getObjectKey())))
                    bMatch = false;   // No match!
            else
                    bMatch = true;    // Match!
        }
        return bMatch;    // MATCH!!!
    }
816060
public boolean isFilterMatch(BaseMessageHeader messageHeader)
    {
        boolean bMatch = super.isFilterMatch(messageHeader);
        if (bMatch)
        {
            if (!(messageHeader instanceof RecordMessageHeader))
                return false;   // Never
            RecordMessageHeader recMessageHeader = (RecordMessageHeader)messageHeader;
            int iRecordMessageType = recMessageHeader.getRecordMessageType();
            if ((iRecordMessageType == DBConstants.AFTER_UPDATE_TYPE)
                    || ((iRecordMessageType == DBConstants.AFTER_DELETE_TYPE)))
            {
                if (!m_htBookmarks.contains(recMessageHeader.getBookmark(DBConstants.BOOKMARK_HANDLE)))
                    bMatch = false;   // No match
                else
                    bMatch = true;
            }
            else if (iRecordMessageType == DBConstants.AFTER_ADD_TYPE)
            {
                if ((m_strSecondaryKey != null) && (m_objKeyData != null))
                {       // If there is a hint, it won't take much processing power to check for a match
                    bMatch = recMessageHeader.isMatchHint(m_strSecondaryKey, m_objKeyData);
                }
                else
                {       // There is no hint, so you could potentially get a ton of add messages
                    bMatch = true;  // What the heck, as long as I don't have to send it up, process this message.
                    for (int i = 0; (this.getMessageListener(i) != null); i++)
                    {
                        if (this.getMessageListener(i) instanceof RemoteReceiveQueue)
                        {
                            bMatch = m_bReceiveAllAdds; // Do I receive all the add messages?
                            break;
                        }
                    }
                }
            }
            else if (iRecordMessageType == DBConstants.CACHE_UPDATE_TYPE)
            {
                if (!m_htBookmarks.contains(recMessageHeader.getBookmark(DBConstants.BOOKMARK_HANDLE)))
                    bMatch = false;   // No match
                else
                    bMatch = true;
            }
            else
                bMatch = false;     // No match
        }
        return bMatch;
    }
439374
@GwtIncompatible("java.util.regex.Pattern")
  public void doesNotContainMatch(Pattern regex) {
    Matcher matcher = regex.matcher(actual());
    if (matcher.find()) {
      failWithoutActual(
          fact("expected not to contain a match for", regex),
          fact("but contained", matcher.group()),
          fact("full string", actualCustomStringRepresentationForPackageMembersToCall()));
    }
  }
267111
boolean matchComment(
            final boolean blockMatching,
            final int markupLevel, final int markupBlockIndex) {

        checkMarkupLevel(markupLevel);

        if (this.markupSelectorItem.anyLevel() || markupLevel == 0 || (this.prev != null && this.prev.matchedMarkupLevels[markupLevel - 1])) {
            // This text has not matched yet, but might match, so we should check

            this.matchesThisLevel = this.markupSelectorItem.matchesComment(markupBlockIndex, this.markupBlockMatchingCounter);

            if (matchesPreviousOrCurrentLevel(markupLevel)) {
                // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

                if (this.next != null) {
                    return this.next.matchComment(blockMatching, markupLevel, markupBlockIndex);
                }
                return (blockMatching? true : this.matchesThisLevel);

            } else if (this.matchesThisLevel) {
                // This filter was not matched before. So the fact that it matches now means we need to consume it,
                // therefore not delegating.

                return (this.next == null);

            }

        } else if (matchesPreviousOrCurrentLevel(markupLevel)) {
            // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

            if (this.next != null) {
                return this.next.matchComment(blockMatching, markupLevel, markupBlockIndex);
            }
            return blockMatching;

        }

        return false;

    }
410846
public void deleteIfMatch(URI uri, String eTag,
			Header[] additionalRequestHeaders, Credentials credentials) {
		ra.getExecutorService().execute(
				new AsyncDeleteIfMatchHandler(ra, handle, uri, eTag,
						additionalRequestHeaders, credentials));
	}
973001
def etag_matches?(list, new_resource = request.post?)
      return !new_resource if list == '*'
      list.to_s.split(/\s*,\s*/).include? response['ETag']
    end
352690
def has_matching_etag(remote_storage, source_storage, path, prefixed_path):
    
    storage_etag = get_etag(remote_storage, path, prefixed_path)
    local_etag = get_file_hash(source_storage, path)
    return storage_etag == local_etag
373315
@Override
	public void prepareConditionalGet(final HttpUriRequest newRequest) {
		transferFirstHeader("ETag", "If-None-Match", this.response, newRequest);
		transferFirstHeader("Last-Modified", "If-Modified-Since", this.response, newRequest);
	}