(request, response)
Validate the current Last-Modified against If-Modified-Since headers.

    If no code has set the Last-Modified response header, then no validation
    will be performed.
Validate the current Last-Modified against If-Modified-Since headers.
Validate the current Last - Modified against If - Modified - Since headers .
def validate_since(request, response):
    """Validate the current Last-Modified against If-Modified-Since headers.

    If no code has set the Last-Modified response header, then no validation
    will be performed.
    """

    lastmod = response.headers.get('Last-Modified')
    if lastmod:
        status = response.status

        since = request.headers.get('If-Unmodified-Since')
        if since and since != lastmod:
            if (status >= 200 and status <= 299) or status == 412:
                return httperror(request, response, 412)

        since = request.headers.get('If-Modified-Since')
        if since and since == lastmod:
            if (status >= 200 and status <= 299) or status == 304:
                if request.method in ("GET", "HEAD"):
                    return redirect(request, response, [], code=304)
                else:
                    return httperror(request, response, 412)
def validate_since ( request , response ) : lastmod = response . headers . get ( 'Last-Modified' ) if lastmod : status = response . status since = request . headers . get ( 'If-Unmodified-Since' ) if since and since != lastmod : if ( status >= 200 and status <= 299 ) or status == 412 : return httperror ( request , response , 412 ) since = request . headers . get ( 'If-Modified-Since' ) if since and since == lastmod : if ( status >= 200 and status <= 299 ) or status == 304 : if request . method in ( "GET" , "HEAD" ) : return redirect ( request , response , [ ] , code = 304 ) else : return httperror ( request , response , 412 )