File: //usr/lib/python3/dist-packages/django/views/decorators/__pycache__/vary.cpython-310.pyc
o
    ʎ�_<  �                   @   s,   d dl mZ d dlmZ dd� Zdd� ZdS )�    ��wraps��patch_vary_headersc                     s   � fdd�}|S )a  
    A view decorator that adds the specified headers to the Vary header of the
    response. Usage:
       @vary_on_headers('Cookie', 'Accept-language')
       def index(request):
           ...
    Note that the header names are not case-sensitive.
    c                    s   t � �� �fdd��}|S )Nc                     s   � | i |��}t |�� |S )Nr   ��args�kwargs�response)�func�headers� �>/usr/lib/python3/dist-packages/django/views/decorators/vary.py�
inner_func   �   
z6vary_on_headers.<locals>.decorator.<locals>.inner_funcr   �r
   r   �r   �r
   r
   �	decorator   s   z"vary_on_headers.<locals>.decoratorr   )r   r   r   r   r
   �vary_on_headers   s   r   c                    s   t � �� fdd��}|S )z�
    A view decorator that adds "Cookie" to the Vary header of a response. This
    indicates that a page's contents depends on cookies. Usage:
        @vary_on_cookie
        def index(request):
            ...
    c                     s   � | i |��}t |d� |S )N)�Cookier   r   r   r   r
   r   $   r   z"vary_on_cookie.<locals>.inner_funcr   r   r   r   r
   �vary_on_cookie   s   	r   N)�	functoolsr   �django.utils.cacher   r   r   r   r   r   r
   �<module>   s