Ñò
vmMc           @   s@   d  d k  l Z d  d k l Z l Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   MiddlewareNotUsed(   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 <| i d ƒ p t t | i ƒ ƒ | d <n | i d ƒ o4 | i i d ƒ } | | d j o d | _ q~ n | i d ƒ o{ | i i d ƒ } | d  j	 o t	 | ƒ } n | d  j	 o; t	 | d ƒ } | d  j	 o | | j o d | _ qq	n | S(   Nt   Dates   Content-Lengtht   ETagt   HTTP_IF_NONE_MATCHi0  s   Last-Modifiedt   HTTP_IF_MODIFIED_SINCE(
   R   t
   has_headert   strt   lent   contentt   METAt   gett   status_codet   NoneR   (   t   selft   requestt   responset   if_none_matcht   if_modified_sincet   last_modified(    (    s@   /usr/local/lib/python2.6/dist-packages/django/middleware/http.pyt   process_response   s     (   t   __name__t
   __module__t   __doc__R   (    (    (    s@   /usr/local/lib/python2.6/dist-packages/django/middleware/http.pyR      s   N(   t   django.core.exceptionsR    t   django.utils.httpR   R   t   objectR   (    (    (    s@   /usr/local/lib/python2.6/dist-packages/django/middleware/http.pyt   <module>   s   