def evaluate_http_conditionals(dav_res, last_modified, entitytag, environ):
if not dav_res:<EOL><INDENT>return<EOL><DEDENT>if "<STR_LIT>" in environ and dav_res.support_etag():<EOL><INDENT>ifmatchlist = environ["<STR_LIT>"].split("<STR_LIT:U+002C>")<EOL>for ifmatchtag in ifmatchlist:<EOL><INDENT>ifmatchtag = ifmatchtag.strip('<STR_LIT>')<EOL>if ifmatchtag == entitytag or ifmatchtag == "<STR_LIT:*>":<EOL><INDENT>break<EOL><DEDENT>raise DAVError(HTTP_PRECONDITION_FAILED, "<STR_LIT>")<EOL><DEDENT><DEDENT>ifModifiedSinceFailed = False<EOL>if "<STR_LIT>" in environ and dav_res.support_modified():<EOL><INDENT>ifmodtime = parse_time_string(environ["<STR_LIT>"])<EOL>if ifmodtime and ifmodtime > last_modified:<EOL><INDENT>ifModifiedSinceFailed = True<EOL><DEDENT><DEDENT>ignoreIfModifiedSince = False<EOL>if "<STR_LIT>" in environ and dav_res.support_etag():<EOL><INDENT>ifmatchlist = environ["<STR_LIT>"].split("<STR_LIT:U+002C>")<EOL>for ifmatchtag in ifmatchlist:<EOL><INDENT>ifmatchtag = ifmatchtag.strip('<STR_LIT>')<EOL>if ifmatchtag == entitytag or ifmatchtag == "<STR_LIT:*>":<EOL><INDENT>if (<EOL>environ["<STR_LIT>"] in ("<STR_LIT:GET>", "<STR_LIT>")<EOL>and not ifModifiedSinceFailed<EOL>):<EOL><INDENT>raise DAVError(HTTP_NOT_MODIFIED, "<STR_LIT>")<EOL><DEDENT>raise DAVError(<EOL>HTTP_PRECONDITION_FAILED, "<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>ignoreIfModifiedSince = True<EOL><DEDENT>if "<STR_LIT>" in environ and dav_res.support_modified():<EOL><INDENT>ifunmodtime = parse_time_string(environ["<STR_LIT>"])<EOL>if ifunmodtime and ifunmodtime <= last_modified:<EOL><INDENT>raise DAVError(<EOL>HTTP_PRECONDITION_FAILED, "<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>if ifModifiedSinceFailed and not ignoreIfModifiedSince:<EOL><INDENT>raise DAVError(HTTP_NOT_MODIFIED, "<STR_LIT>")<EOL><DEDENT>return<EOL>
Handle 'If-...:' headers (but not 'If:' header).

    If-Match
        @see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24
        Only perform the action if the client supplied entity matches the
        same entity on the server. This is mainly for methods like
        PUT to only update a resource if it has not been modified since the
        user last updated it.
        If-Match: "737060cd8c284d8af7ad3082f209582d"
    If-Modified-Since
        @see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25
        Allows a 304 Not Modified to be returned if content is unchanged
        If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
    If-None-Match
        @see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26
        Allows a 304 Not Modified to be returned if content is unchanged,
        see HTTP ETag
        If-None-Match: "737060cd8c284d8af7ad3082f209582d"
    If-Unmodified-Since
        @see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.28
        Only send the response if the entity has not been modified since a
        specific time.