o ʎ_X@s@ddlmZmZmZddlmZddlmZGdddeZdS)) cc_delim_reget_conditional_responseset_response_etag)MiddlewareMixin)parse_http_date_safec@s eZdZdZddZddZdS)ConditionalGetMiddlewarez Handle conditional GET operations. If the response has an ETag or Last-Modified header and the request has If-None-Match or If-Modified-Since, replace the response with HttpNotModified. Add an ETag header if needed. cCsf|jdkr|S||r|dst||d}|d}|o$t|}|s)|r1t||||dS|S)NGETETagz Last-Modified)etag last_modifiedresponse)method needs_etag has_headerrgetrr)selfrequestr r r r8/usr/lib/python3/dist-packages/django/middleware/http.pyprocess_responses    z)ConditionalGetMiddleware.process_responsecCs$t|dd}tdd|DS)z:Return True if an ETag header should be added to response.z Cache-Controlcss|] }|dkVqdS)zno-storeN)lower).0headerrrr )sz6ConditionalGetMiddleware.needs_etag..)rsplitrall)rr cache_control_headersrrrr&sz#ConditionalGetMiddleware.needs_etagN)__name__ __module__ __qualname____doc__rrrrrrrs rN) django.utils.cacherrrdjango.utils.deprecationrdjango.utils.httprrrrrrs