| Server IP : 35.80.110.71 / Your IP : 216.73.216.21 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/webob/__pycache__/ |
Upload File : |
�
���f�� � �X � d dl Z d dlZd dlZd dlmZ d dlmZmZ d dlmZ d dl m
Z
d dlmZm
Z
d dlmZmZmZmZmZmZmZ d dlmZmZ d d lmZmZmZ d d
lmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z, d dl-m.Z. d dl/m0Z0 d d
l1m2Z2m3Z3m4Z4 d dl5Z6dgZ8 e jr de jt � Z; e jr de jt � Z<dZ= e>� Z? G d� de>� Z@d!d�ZAd"d�ZB G d� de>� ZC G d� de>� ZD G d� de>� ZEd� ZFd� ZGd� ZHd� ZId� ZJd � ZKy# e7$ r d dl6Z6Y ��w xY w)#� N)� b64encode)�datetime� timedelta)�md5)�ContentRange)�CacheControl�serialize_cache_control)�PY2�bytes_�native_�string_types� text_type� url_quote�urlparse)�Cookie�make_cookie)�parse_date_delta�serialize_date_delta�timedelta_to_seconds)�
CHARSET_RE� SCHEME_RE� converter�date_header�
header_getter�list_header�
parse_auth�parse_content_range�parse_etag_response� parse_int�parse_int_safe�serialize_auth�serialize_content_range�serialize_etag_response�
serialize_int)�ResponseHeaders)�BaseRequest)�status_generic_reasons�status_reasons�warn_deprecation�Responsez(([a-z0-9]+)=(?:"([^"]*)"|([a-z0-9_.-]*))z^[a-z0-9_.-]+$s
� �c �� � e Zd ZdZdZdZdZdZdZdZ dZ
ddddddefd�Ze
d� � Zd � Zd
� Zdod�Zd� Zd
� Z eeeej �� Zd� Zd� Z eeeej �� xZZd� Zd� Zd� Z eeeeej �� Zd� Zd� Z eeeej �� Z d� Z!dpd�Z" ee!e"e"� Z#d� Z$d� Z%d� Z& ee$e%e&� xZ'Z(d� Z) ee)� Z*d� Z+d� Z,d� Z- ee+e,e-e+j �� Z. ee+e,e-d� xZ/Z0d � Z1d!� Z2d"� Z3 ee1e2e3e1j �� Z4d#� Z5d$� Z6d%� Z7d&� Z8 ee6e7e8e6j �� Z9 e:d'd(� Z; e:d)d*� Z< e= e>d+d,� e?e@d-� ZA e>d.d/� ZB e:d0d1� ZC e>d2d3� ZD e>d4d3� ZE e>d5d6� ZF e>d7d8� ZG e= e>d9d:� eHeId;� ZJ eKd<d=� ZL eKd>d?� ZM eKd@dA� ZN e>dBdC� ZO e=eOePeQdD� ZRedE� � ZS e>dFdG� ZT e>dHdI� ZU e= e>dJdK� eVe@d-� ZW e= e>dLdM� eXeYdN� ZZ e>dOdP� Z[ e= e>dQdR� e\e]� Z^dS� Z_dT� Z`dU� Za ee_e`eae_j �� ZbdV� ZcdW� ZddX� Ze eecedeeecj �� ZfdY� ZgdZ� Zhd[� Zi eegeheiegj � Zj dqd\�Zkdrd]�Zldsd^�Zmd_� ZndZod`� Zpda� Zqdb� Zrdc� Zs eepeqerepj �� Ztdtdd�Zu ede� eu� Zvdudf�Zwdg� Zxdvdh�Zyezdi� � Z{dj� Z|dk� Z}dlZ~dm� Zdn� Z�y)wr* a�
Represents a WSGI response.
If no arguments are passed, creates a :class:`~Response` that uses a
variety of defaults. The defaults may be changed by sub-classing the
:class:`~Response`. See the :ref:`sub-classing notes
<response_subclassing_notes>`.
:cvar ~Response.body: If ``body`` is a ``text_type``, then it will be
encoded using either ``charset`` when provided or ``default_encoding``
when ``charset`` is not provided if the ``content_type`` allows for a
``charset``. This argument is mutually exclusive with ``app_iter``.
:vartype ~Response.body: bytes or text_type
:cvar ~Response.status: Either an :class:`int` or a string that is
an integer followed by the status text. If it is an integer, it will be
converted to a proper status that also includes the status text. Any
existing status text will be kept. Non-standard values are allowed.
:vartype ~Response.status: int or str
:cvar ~Response.headerlist: A list of HTTP headers for the response.
:vartype ~Response.headerlist: list
:cvar ~Response.app_iter: An iterator that is used as the body of the
response. Should conform to the WSGI requirements and should provide
bytes. This argument is mutually exclusive with ``body``.
:vartype ~Response.app_iter: iterable
:cvar ~Response.content_type: Sets the ``Content-Type`` header. If no
``content_type`` is provided, and there is no ``headerlist``, the
``default_content_type`` will be automatically set. If ``headerlist``
is provided then this value is ignored.
:vartype ~Response.content_type: str or None
:cvar conditional_response: Used to change the behavior of the
:class:`~Response` to check the original request for conditional
response headers. See :meth:`~Response.conditional_response_app` for
more information.
:vartype conditional_response: bool
:cvar ~Response.charset: Adds a ``charset`` ``Content-Type`` parameter. If
no ``charset`` is provided and the ``Content-Type`` is text, then the
``default_charset`` will automatically be added. Currently the only
``Content-Type``'s that allow for a ``charset`` are defined to be
``text/*``, ``application/xml``, and ``*/*+xml``. Any other
``Content-Type``'s will not have a ``charset`` added. If a
``headerlist`` is provided this value is ignored.
:vartype ~Response.charset: str or None
All other response attributes may be set on the response by providing them
as keyword arguments. A :exc:`TypeError` will be raised for any unexpected
keywords.
.. _response_subclassing_notes:
**Sub-classing notes:**
* The ``default_content_type`` is used as the default for the
``Content-Type`` header that is returned on the response. It is
``text/html``.
* The ``default_charset`` is used as the default character set to return on
the ``Content-Type`` header, if the ``Content-Type`` allows for a
``charset`` parameter. Currently the only ``Content-Type``'s that allow
for a ``charset`` are defined to be: ``text/*``, ``application/xml``, and
``*/*+xml``. Any other ``Content-Type``'s will not have a ``charset``
added.
* The ``unicode_errors`` is set to ``strict``, and access on a
:attr:`~Response.text` will raise an error if it fails to decode the
:attr:`~Response.body`.
* ``default_conditional_response`` is set to ``False``. This flag may be
set to ``True`` so that all ``Response`` objects will attempt to check
the original request for conditional response headers. See
:meth:`~Response.conditional_response_app` for more information.
* ``default_body_encoding`` is set to 'UTF-8' by default. It exists to
allow users to get/set the ``Response`` object using ``.text``, even if
no ``charset`` has been set for the ``Content-Type``.
� text/html�UTF-8�strictFNc � � |�[|�Yd|v sd|v rQd|v r|j d� } n|j d� } t j | d�� j d� }|�d}|�|�d}n
|�t d� �|�d | _ n|| _ d | _ |�g | _ n|| _ d }
|t ur|}
| j
d
dk7 xr | j
d d d
v}|xs | j }|�g|re|rcd|v }|rd }
|
}
|s |t u r| j r| j }
|
r|dk( st |� r|d|
z z
}| j j d|f� |�| j | _ nt! |� | _ |��|r�t# |t$ � r.|
xs | j&