Format: application/x-python-code
⬇ Download File (8.2 KB)
   1  o
   2  
   3  D'h�$�@s�ddlmZddlZddlmZddlmZddlmZ	ddlm
   4  Zddlm
   5  Z
   6  dd	lmZdd
   7  lmZejr=ddlmZGdd
   8  �d
   9  e	�ZGdd�de�Z
  10  dS)�)�annotationsN)�
  11  BadRequest)�
  12  HTTPException)�Request)�Response�)�json)�current_app)�_split_blueprint_path)�RulecseZdZUdZeZded<dZded<dZded<dZ	d	ed
  13  <dZ
  14  ded<dZded
  15  <dZded<e
  16  d)�fdd��Zejd*dd��Ze
  17  d)�fdd��Zejd*dd��Ze
  18  d)�fdd��Zejd*dd��Ze
  19  d+dd��Ze
  20  d+dd��Ze
  21  d,d!d"��Zd-�fd#d$�Zd.�fd'd(�Z�ZS)/ra�The request object used by default in Flask.  Remembers the
  22      matched endpoint and view arguments.
  23  
  24      It is what ends up as :class:`~flask.request`.  If you want to replace
  25      the request object used you can subclass this and set
  26      :attr:`~flask.Flask.request_class` to your subclass.
  27  
  28      The request object is a :class:`~werkzeug.wrappers.Request` subclass and
  29      provides all of the attributes Werkzeug defines plus a few Flask
  30      specific ones.
  31      �t.Any�json_moduleNzRule | None�url_rulezdict[str, t.Any] | None�	view_argszHTTPException | None�routing_exception�
  32  int | None�_max_content_length�_max_form_memory_size�_max_form_parts�returnc�&|jdur|jStst�jStjdS)a�The maximum number of bytes that will be read during this request. If
  33          this limit is exceeded, a 413 :exc:`~werkzeug.exceptions.RequestEntityTooLarge`
  34          error is raised. If it is set to ``None``, no limit is enforced at the
  35          Flask application level. However, if it is ``None`` and the request has
  36          no ``Content-Length`` header and the WSGI server does not indicate that
  37          it terminates the stream, then no data is read to avoid an infinite
  38          stream.
  39  
  40          Each request defaults to the :data:`MAX_CONTENT_LENGTH` config, which
  41          defaults to ``None``. It can be set on a specific ``request`` to apply
  42          the limit to that specific view. This should be set appropriately based
  43          on an application's or view's specific needs.
  44  
  45          .. versionchanged:: 3.1
  46              This can be set per-request.
  47  
  48          .. versionchanged:: 0.6
  49              This is configurable through Flask config.
  50          NZMAX_CONTENT_LENGTH)rr	�super�max_content_length�config��self��	__class__��DC:\Users\shubh\Videos\agent\nova\Lib\site-packages\flask/wrappers.pyr;s
  51  
  52  
  53  zRequest.max_content_length�value�NonecC�
  54  ||_dS�N)r�rr rrrrX�
  55  cr)a�The maximum size in bytes any non-file form field may be in a
  56          ``multipart/form-data`` body. If this limit is exceeded, a 413
  57          :exc:`~werkzeug.exceptions.RequestEntityTooLarge` error is raised. If it
  58          is set to ``None``, no limit is enforced at the Flask application level.
  59  
  60          Each request defaults to the :data:`MAX_FORM_MEMORY_SIZE` config, which
  61          defaults to ``500_000``. It can be set on a specific ``request`` to
  62          apply the limit to that specific view. This should be set appropriately
  63          based on an application's or view's specific needs.
  64  
  65          .. versionchanged:: 3.1
  66              This is configurable through Flask config.
  67          NZMAX_FORM_MEMORY_SIZE)rr	r�max_form_memory_sizerrrrrr&\�
  68  
  69  
  70  zRequest.max_form_memory_sizecCr"r#)rr$rrrr&sr%cr)a�The maximum number of fields that may be present in a
  71          ``multipart/form-data`` body. If this limit is exceeded, a 413
  72          :exc:`~werkzeug.exceptions.RequestEntityTooLarge` error is raised. If it
  73          is set to ``None``, no limit is enforced at the Flask application level.
  74  
  75          Each request defaults to the :data:`MAX_FORM_PARTS` config, which
  76          defaults to ``1_000``. It can be set on a specific ``request`` to apply
  77          the limit to that specific view. This should be set appropriately based
  78          on an application's or view's specific needs.
  79  
  80          .. versionchanged:: 3.1
  81              This is configurable through Flask config.
  82          NZMAX_FORM_PARTS)rr	r�max_form_partsrrrrrr(wr'zRequest.max_form_partscCr"r#)rr$rrrr(�r%�
  83  str | NonecCs|jdur	|jjSdS)aThe endpoint that matched the request URL.
  84  
  85          This will be ``None`` if matching failed or has not been
  86          performed yet.
  87  
  88          This in combination with :attr:`view_args` can be used to
  89          reconstruct the same URL or a modified URL.
  90          N)r�endpointrrrrr*�s
  91  
  92  zRequest.endpointcCs(|j}|durd|vr|�d�dSdS)ajThe registered name of the current blueprint.
  93  
  94          This will be ``None`` if the endpoint is not part of a
  95          blueprint, or if URL matching failed or has not been performed
  96          yet.
  97  
  98          This does not necessarily match the name the blueprint was
  99          created with. It may have been nested, or registered with a
 100          different name.
 101          N�.r)r*�
 102  rpartition)rr*rrr�	blueprint�szRequest.blueprint�	list[str]cCs|j}|dur	gSt|�S)z�The registered names of the current blueprint upwards through
 103          parent blueprints.
 104  
 105          This will be an empty list if there is no current blueprint, or
 106          if URL matching failed.
 107  
 108          .. versionadded:: 2.0.1
 109          N)r-r
 110  )r�namerrr�
 111  blueprints�s
 112  zRequest.blueprintscsLt���trtjr |jdkr"|js$ddlm}||�dSdSdSdSdS)Nzmultipart/form-datar)�attach_enctype_error_multidict)r�_load_form_datar	�debug�mimetype�filesZdebughelpersr1)rr1rrrr2�s
 113  ��
 114  ��zRequest._load_form_data�e�ValueError | Nonec
 115  s<zt��|�WSty}z
 116  trtjr�t�|�d}~wwr#)r�on_json_loading_failedrr	r3)rr6Zebrrrrr8�s
 117  ��zRequest.on_json_loading_failed)rr)r rrr!)rr))rr.)rr!)r6r7rr)�__name__�
 118  __module__�__qualname__�__doc__rr
 119  �__annotations__rrrrrr�propertyr�setterr&r(r*r-r0r2r8�
 120  __classcell__rrrrrs:
 121  rcs<eZdZUdZdZded<eZdZe	d
 122  �fdd	��Z
 123  �ZS)ra�The response object that is used by default in Flask.  Works like the
 124      response object from Werkzeug but is set to have an HTML mimetype by
 125      default.  Quite often you don't have to create this object yourself because
 126      :meth:`~flask.Flask.make_response` will take care of that for you.
 127  
 128      If you want to replace the response object used you can subclass this and
 129      set :attr:`~flask.Flask.response_class` to your subclass.
 130  
 131      .. versionchanged:: 1.0
 132          JSON support is added to the response, like the request. This is useful
 133          when testing to get the test client response data as JSON.
 134  
 135      .. versionchanged:: 1.0
 136  
 137          Added :attr:`max_cookie_size`.
 138      z	text/htmlr)�default_mimetypeFr�intcstrtjdSt�jS)z�Read-only view of the :data:`MAX_COOKIE_SIZE` config key.
 139  
 140          See :attr:`~werkzeug.wrappers.Response.max_cookie_size` in
 141          Werkzeug's docs.
 142          ZMAX_COOKIE_SIZE)r	rr�max_cookie_sizerrrrrC�s
 143  zResponse.max_cookie_size)rrB)r9r:r;r<rAr=rr
 144  Zautocorrect_location_headerr>rCr@rrrrr�s
 145  r)�
 146  __future__r�typing�tZwerkzeug.exceptionsrrZwerkzeug.wrappersrZRequestBaserZResponseBase�r�globalsr	�helpersr
 147  �
 148  TYPE_CHECKINGZwerkzeug.routingrrrrr�<module>sM