
    hP                     F    S SK JrJrJr  S SKJr  S SKJr   " S S\5      rg)    )cc_delim_reget_conditional_responseset_response_etag)MiddlewareMixin)parse_http_date_safec                   $    \ rS rSrSrS rS rSrg)ConditionalGetMiddleware   z
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.
c                 8   UR                   S:w  a  U$ U R                  U5      (       a!  UR                  S5      (       d  [        U5        UR	                  S5      nUR	                  S5      nU=(       a    [        U5      nU(       d  U(       a  [        UUUUS9$ U$ )NGETETagzLast-Modified)etaglast_modifiedresponse)method
needs_etag
has_headerr   getr   r   )selfrequestr   r   r   s        H/var/www/html/env/lib/python3.13/site-packages/django/middleware/http.pyprocess_response)ConditionalGetMiddleware.process_response   s     >>U"O??8$$X-@-@-H-Hh'||F# _5%M*>}*M=++!	      c                 r    [         R                  " UR                  SS5      5      n[        S U 5       5      $ )z:Return True if an ETag header should be added to response.zCache-Control c              3   F   #    U  H  oR                  5       S :g  v   M     g7f)zno-storeN)lower).0headers     r   	<genexpr>6ConditionalGetMiddleware.needs_etag.<locals>.<genexpr>(   s     T>SF<<>Z/>Ss   !)r   splitr   all)r   r   cache_control_headerss      r   r   #ConditionalGetMiddleware.needs_etag%   s1     + 1 1(,,PR2S TT>STTTr    N)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__r'   r   r   r	   r	      s    0Ur   r	   N)	django.utils.cacher   r   r   django.utils.deprecationr   django.utils.httpr   r	   r'   r   r   <module>r1      s    W W 4 2"U "Ur   