ó
K~‰Pc           @   s0   d  d l  m Z m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t	   http_datet   parse_http_date_safet   ConditionalGetMiddlewarec           B   s   e  Z d  Z d „  Z RS(   s  
    Handles conditional GET operations. If the response has a ETag or
    Last-Modified header, and the request has If-None-Match or
    If-Modified-Since, the response is replaced by an HttpNotModified.

    Also sets the Date and Content-Length response-headers.
    c         C   s	  t  ƒ  | d <| j rC | j d ƒ rC t t | j ƒ ƒ | d <n  | j d ƒ rƒ | j j d ƒ } | | d k rƒ d | _ qƒ n  | j d ƒ r| j j d ƒ } | d  k	 r¿ t
 | ƒ } n  | d  k	 rt
 | d ƒ } | d  k	 r| | k rd | _ qqn  | S(   Nt   Dates   Content-Lengtht   ETagt   HTTP_IF_NONE_MATCHi0  s   Last-Modifiedt   HTTP_IF_MODIFIED_SINCE(   R    t	   streamingt
   has_headert   strt   lent   contentt   METAt   gett   status_codet   NoneR   (   t   selft   requestt   responset   if_none_matcht   if_modified_sincet   last_modified(    (    s/   ../Django//lib/python/django/middleware/http.pyt   process_response   s     (   t   __name__t
   __module__t   __doc__R   (    (    (    s/   ../Django//lib/python/django/middleware/http.pyR      s   N(   t   django.utils.httpR    R   t   objectR   (    (    (    s/   ../Django//lib/python/django/middleware/http.pyt   <module>   s   