HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/django/middleware/__pycache__/gzip.cpython-310.pyc
o

�h��@sPddlmZddlmZddlmZddlmZmZed�Z	Gdd�de�Z
dS)	�)�patch_vary_headers)�MiddlewareMixin)�_lazy_re_compile)�compress_sequence�compress_stringz\bgzip\bc@seZdZdZdZdd�ZdS)�GZipMiddlewarez�
    Compress content if the browser allows gzip compression.
    Set the Vary header accordingly, so that caches will base their storage
    on the Accept-Encoding header.
    �dcs|jst|j�dkr|S|�d�r|St|d�|j�dd�}t�|�s&|S|jrI|j	r;|j
���fdd�}|�|_
n	t|j
�jd�|_
|j
d	=n t|j�jd�}t|�t|j�kr\|S||_tt|j��|j
d	<|�d
�}|r||�d�r|d||j
d
<d
|j
d<|S)N��zContent-Encoding)zAccept-Encoding�HTTP_ACCEPT_ENCODING�cs*��2z3dHW}t|�jd�Vq6dS)N��max_random_bytes)rr
)�chunk��orignal_iterator�self��I/usr/local/CyberCP/lib/python3.10/site-packages/django/middleware/gzip.py�gzip_wrapper's�
��z5GZipMiddleware.process_response.<locals>.gzip_wrapperrzContent-Length�ETag�"zW/�gzip)�	streaming�len�content�
has_headerr�META�get�re_accepts_gzip�search�is_async�streaming_contentrr
�headersr�str�
startswith)r�request�response�aer�compressed_content�etagrrr�process_responses>



�
�

zGZipMiddleware.process_responseN)�__name__�
__module__�__qualname__�__doc__r
r*rrrrr	srN)�django.utils.cacher�django.utils.deprecationr�django.utils.regex_helperr�django.utils.textrrrrrrrr�<module>s