def validate_since():
 response = cherrypy.serving.response
 lastmod = response.headers.get('Last-Modified')
 if lastmod:
  (status, reason, msg) = _httputil.valid_status(response.status)
  request = cherrypy.serving.request
  since = request.headers.get('If-Unmodified-Since')
  if (since and (since != lastmod)):
   if (((status >= 200) and (status <= 299)) or (status == 412)):
    raise cherrypy.HTTPError(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')):
     raise cherrypy.HTTPRedirect([], 304)
    else:
     raise cherrypy.HTTPError(412)

def validate_since ( ) : response = cherrypy . serving . response lastmod = response . headers . get ( 'Last-Modified' ) if lastmod : ( status , reason , msg ) = _httputil . valid_status ( response . status ) request = cherrypy . serving . request since = request . headers . get ( 'If-Unmodified-Since' ) if ( since and ( since != lastmod ) ) : if ( ( ( status >= 200 ) and ( status <= 299 ) ) or ( status == 412 ) ) : raise cherrypy . HTTPError ( 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' ) ) : raise cherrypy . HTTPRedirect ( [ ] , 304 ) else : raise cherrypy . HTTPError ( 412 )
validate the current last-modified against if-modified-since headers .