def _evaluate_if_headers(self, res, environ):
<EOL>if "<STR_LIT>" not in environ:<EOL><INDENT>util.parse_if_header_dict(environ)<EOL><DEDENT>if res is None:<EOL><INDENT>return<EOL><DEDENT>ifDict = environ["<STR_LIT>"]<EOL>last_modified = -<NUM_LIT:1>  <EOL>entitytag = "<STR_LIT>"  <EOL>if res.get_last_modified() is not None:<EOL><INDENT>last_modified = res.get_last_modified()<EOL><DEDENT>if res.get_etag() is not None:<EOL><INDENT>entitytag = res.get_etag()<EOL><DEDENT>if (<EOL>"<STR_LIT>" in environ<EOL>or "<STR_LIT>" in environ<EOL>or "<STR_LIT>" in environ<EOL>or "<STR_LIT>" in environ<EOL>):<EOL><INDENT>util.evaluate_http_conditionals(res, last_modified, entitytag, environ)<EOL><DEDENT>if "<STR_LIT>" not in environ:<EOL><INDENT>return<EOL><DEDENT>refUrl = res.get_ref_url()<EOL>lockMan = self._davProvider.lock_manager<EOL>locktokenlist = []<EOL>if lockMan:<EOL><INDENT>lockList = lockMan.get_indirect_url_lock_list(<EOL>refUrl, environ["<STR_LIT>"]<EOL>)<EOL>for lock in lockList:<EOL><INDENT>locktokenlist.append(lock["<STR_LIT>"])<EOL><DEDENT><DEDENT>if not util.test_if_header_dict(res, ifDict, refUrl, locktokenlist, entitytag):<EOL><INDENT>self._fail(HTTP_PRECONDITION_FAILED, "<STR_LIT>")<EOL><DEDENT>return<EOL>
Apply HTTP headers on <path>, raising DAVError if conditions fail.

        Add environ['wsgidav.conditions.if'] and environ['wsgidav.ifLockTokenList'].
        Handle these headers:

          - If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since:
            Raising HTTP_PRECONDITION_FAILED or HTTP_NOT_MODIFIED
          - If:
            Raising HTTP_PRECONDITION_FAILED

        @see http://www.webdav.org/specs/rfc4918.html#HEADER_If
        @see util.evaluate_http_conditionals