o
    m=8j{|                  
   @   s$  U d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlm	Z	m
Z
mZ d dlmZ d dlmZ d dlmZmZmZmZmZmZmZ d dlmZ d dlZd dlmZmZmZmZmZ d dlm Z  d	d
l!m"Z" d	dl#m$Z$ d	dl%m&Z& d	dl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4 d	dl5m6Z6 d	dl7m8Z8 d	dl9m:Z:m;Z; d	dl<m=Z=m>Z> d	dl?m@Z@mAZAmBZBmCZCmDZD d	dlEmFZFmGZG d	dlHmIZI dZJerd	dlKmLZL d	dlMmNZN d	dlOmPZP edZQejRddddG dd dZSeTeUB eVB eSB ZWejXejY d ZZeeT e[d< d eZ d!Z\eeT e[d"< d#]d$^d%d& d'e_e`d(d) D ZaeeT e[d*< d+ZbeeT e[d,< d-eb d.ea d/ZceeT e[d0< d1e\ d2e\ d.ec d3ZdeeT e[d4< eed5ZfeeeT  e[d6< eeedZgeeeT  e[d7< G d8d9 d9eeTe0e B ef e/ZhG d:d; d;ehZidS )<    N)IteratorMappingMutableMapping)Pattern)MappingProxyType)TYPE_CHECKINGAnyFinalOptionalTypeVarcastoverload)	parse_qsl)CIMultiDictCIMultiDictProxy	MultiDictMultiDictProxyMultiMapping)URL   )hdrs)parse_cookie_header)AbstractStreamWriter)	_SENTINELDEBUGDEFAULT_CHUNK_SIZEETAG_ANYLIST_QUOTED_ETAG_REChainMapProxyETagHeadersMixin
RequestKeyparse_http_datereifysentinelset_exception)RawRequestMessage)HttpVersion)BodyPartReaderMultipartReader)EmptyStreamReaderStreamReader)DEFAULT_JSON_DECODERJSONDecoderLooseHeaders
RawHeadersStrOrURL)HTTPRequestEntityTooLargeNotAppKeyWarning)StreamResponse)BaseRequest	FileFieldRequest)Application)RequestHandler)UrlMappingMatchInfo_TT)auto_attribsfrozenslotsc                   @   s<   e Zd ZU eed< eed< ejed< eed< ee ed< dS )r5   namefilenamefilecontent_typeheadersN)__name__
__module____qualname__str__annotations__ioBufferedReaderr    rJ   rJ   Z/home/nk/hobo-godmode/plappi-mvp/.venv/lib/python3.10/site-packages/aiohttp/web_request.pyr5   E   s   
 
r5   z!#$%&'*+.^_`|~-_TCHAR[z]+_TOKENz[{}] c                 c   s    | ]}t |V  qd S N)chr).0crJ   rJ   rK   	<genexpr>U   s    rT   )	       !   #      _QDTEXTz
\\[\t !-~]_QUOTED_PAIRz"(?:|z)*"_QUOTED_STRING(z)=(z)(:\d{1,4})?_FORWARDED_PAIRz\\([\t !-~])_QUOTED_PAIR_REPLACE_RE_FORWARDED_PAIR_REc                   @   s  e Zd ZU ejejejejejhZ	e
jeg dB ZdZee dB ed< dZedB ed< e Zee ed< ddddddded	ed
ddedddejdedeee eB ef dB dedB dedB dedB ddfddZe e e e e e e ddee!B de"e!B de#e!B dee!B dee!B dee!B dee!B dd fddZ$e%dddZ&e%dd d!Z'e%dej(dB fd"d#Z)e%defd$d%Z*e%defd&d'Z+e,defd(d)Z-e,de.fd*d+Z/e,dejfd,d-Z0e1d.ee2 de2fd/d0Z3e1d.edefd1d0Z3d.eee2 B defd2d0Z3e1d.ee2 d3e2ddfd4d5Z4e1d.ed3eddfd6d5Z4d.eee2 B d3eddfd7d5Z4d.eee2 B ddfd8d9Z5defd:d;Z6de7eee B  fd<d=Z8e,de9fd>d?Z:e,de;e<eef d@f fdAdBZ=e,defdCdDZ>e,defdEdFZ?e,de@fdGdHZAe,defdIdJZBe,dedB fdKdLZCe,de.fdMdNZDe,defdOdPZEe,defdQdRZFe,defdSdTZGe,ddVdWZHe,defdXdYZIe,deJe fdZd[ZKe,deLfd\d]ZMe,deNjNdB fd^d_ZOe,deNjNdB fd`daZPeQdbede7eR fdcddZSeTdeedB de;eRd@f dB fdfdgZUe,de;eRd@f dB fdhdiZVe,de;eRd@f dB fdjdkZWe,deNjNdB fdldmZXe,de9fdndoZYe,de<eef fdpdqZZe,de[fdrdsZ\e,defdtduZ]e%de9fdvdwZ^e%de9fdxdyZ_e,de9fdzd{Z`dd|d}Zadefd~dZbdefddZcedddeedefddZfdegfddZhdddZiddededefddZjdefddZkdelde9fddZmde9fddZndeoddfddZpdeqddfddZrdddZsdS )r4   )_message	_protocol_payload_writer_payload_headers_method_version_rel_url_post_read_bytes_state_cache_task_client_max_size_loop_transport_sslcontext_transport_peernameNrj   rk   _seen_str_keysi   )client_max_sizestateschemehostremotemessagepayloadprotocolr8   payload_writertaskasyncio.Task[None]looprt   ru   rv   rw   rx   returnc                C   s  || _ || _|| _|| _|j| _|j| _|j| _	i | _
|j}|jrJ|	d ur*||	}|
d ur3||
}|| j
d< |j| j
d< |j| j
d< | | _n|| _|	d urV|	| j
d< |
d ur_|
| j
d< |d u rei n|| _|| _|| _|| _|j| _|j| _|j| _|d ur|| j
d< d S d S )Nurlrw   rv   rx   )rb   rc   rd   re   rB   rf   methodrg   versionrh   rm   r   absolutewith_scheme	with_hostrw   rv   relativeri   rl   rn   ro   rp   ssl_contextrq   peernamerr   sockname_transport_sockname)selfry   rz   r{   r|   r}   r   rt   ru   rv   rw   rx   r   rJ   rJ   rK   __init__   sB   




zBaseRequest.__init__r   rel_urlrB   rv   rw   rx   rt   r   r   rB   c                C   s  | j rtdi }|tur||d< |tur#t|}	|	|d< t|	|d< |tur>tt||d< tdd |d  D |d< | j	j
di |}
i }|turQ||d	< |turY||d
< |tura||d< |tu rh| j}| j|
| j| j| j| j| jf|| j d|S )a  Clone itself with replacement some attributes.

        Creates and returns a new instance of Request object. If no parameters
        are given, an exact copy is returned. If a parameter is not passed, it
        will reuse the one from the current request object.
        z.Cannot clone request after reading its contentr   r   pathrB   c                 s   s(    | ]\}}| d | d fV  qdS )utf-8N)encode)rR   kvrJ   rJ   rK   rT      s
    
z$BaseRequest.clone.<locals>.<genexpr>raw_headersrv   rw   rx   )rt   ru   NrJ   )rk   RuntimeErrorr$   r   rF   r   r   tupleitemsrb   _replacero   	__class__re   rc   rd   rn   rp   rl   copy)r   r   r   rB   rv   rw   rx   rt   dctnew_urlry   kwargsrJ   rJ   rK   clone   sJ   
	zBaseRequest.clonec                 C      | j S rP   )rn   r   rJ   rJ   rK   r}         zBaseRequest.taskc                 C   r   rP   )rc   r   rJ   rJ   rK   r{     r   zBaseRequest.protocolc                 C   s   | j d u rd S | j jS rP   )rc   	transportr   rJ   rJ   rK   r     s   
zBaseRequest.transportc                 C   r   rP   )rd   r   rJ   rJ   rK   writer  r   zBaseRequest.writerc                 C   r   rP   )ro   r   rJ   rJ   rK   rt     r   zBaseRequest.client_max_sizec                 C      t jdtdd | jS )NzRequest.message is deprecated   
stacklevel)warningswarnDeprecationWarningrb   r   rJ   rJ   rK   ry     s   zBaseRequest.messagec                 C   r   rP   )ri   r   rJ   rJ   rK   r     r   zBaseRequest.rel_urlc                 C   r   )Nz#request.loop property is deprecated   r   )r   r   r   rp   r   rJ   rJ   rK   r     s   zBaseRequest.loopkeyc                 C      d S rP   rJ   r   r   rJ   rJ   rK   __getitem__(     zBaseRequest.__getitem__c                 C   r   rP   rJ   r   rJ   rJ   rK   r   +  r   c                 C   s
   | j | S rP   rl   r   rJ   rJ   rK   r   .     
valuec                 C   r   rP   rJ   r   r   r   rJ   rJ   rK   __setitem__1  r   zBaseRequest.__setitem__c                 C   r   rP   rJ   r   rJ   rJ   rK   r   4  r   c                 C   s>   t |ts|tjvrtj| tjdtdd || j|< d S )NzIt is recommended to use web.RequestKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#request-s-storager   )categoryr   )	
isinstancer!   r4   rs   addr   r   r2   rl   r   rJ   rJ   rK   r   7  s   c                 C   s   | j |= d S rP   r   r   rJ   rJ   rK   __delitem__C  s   zBaseRequest.__delitem__c                 C   
   t | jS rP   )lenrl   r   rJ   rJ   rK   __len__F  r   zBaseRequest.__len__c                 C   r   rP   )iterrl   r   rJ   rJ   rK   __iter__I  r   zBaseRequest.__iter__c                 C   s
   | j dkS )z5A bool indicating if the request is handled with SSL.https)rv   r   rJ   rJ   rK   secureN     
zBaseRequest.secure.c                 C   sd  g }| j jtjdD ]}t|}d}d}i }|t| d|  kr)|k rn qt	
||}|durm|r>|d|}nd| \}}	}
|	d dkrUtd|	dd	 }	|
r[|	|
7 }	|	|| < |t|d7 }d
}n5|| dkrd}i }|t| |d7 }n|| dkrd}|d7 }n|| dv r|d7 }n|d|}d|  kr|k s+q qt|S )a  A tuple containing all parsed Forwarded header(s).

        Makes an effort to parse Forwarded headers as specified by RFC 7239:

        - It adds one (immutable) dictionary per Forwarded 'field-value', ie
          per proxy. The element corresponds to the data in the Forwarded
          field-value added by the first proxy encountered by the client. Each
          subsequent item corresponds to those added by later proxies.
        - It checks that every value has valid syntax in general as specified
          in section 4: either a 'token' or a 'quoted-string'.
        - It un-escapes found escape sequences.
        - It does NOT validate 'by' and 'for' contents as specified in section
          6.
        - It does NOT validate 'host' contents (Host ABNF).
        - It does NOT validate 'proto' contents for valid URI scheme names.

        Returns a tuple containing one or more immutable dicts
        rJ   r   FN,"z\1r   T;z 	)rb   rB   getallr   	FORWARDEDr   appendtypesr   ra   matchfindgroupsr`   sublowergroupr   )r   elemsfield_valuelengthposneed_separatorelemr   r>   r   portrJ   rJ   rK   	forwardedS  sD   


 zBaseRequest.forwardedc                 C   s   | j rdS dS )a  A string representing the scheme of the request.

        Hostname is resolved in this order:

        - overridden value by .clone(scheme=new_scheme) call.
        - type of connection to peer: HTTPS if socket is SSL, HTTP otherwise.

        'http' or 'https'.
        r   http)rq   r   rJ   rJ   rK   rv     s   zBaseRequest.schemec                 C   r   )zyRead only property for getting HTTP method.

        The value is upper-cased str like 'GET', 'POST', 'PUT' etc.
        )rg   r   rJ   rJ   rK   r        zBaseRequest.methodc                 C   r   )zxRead only property for getting HTTP version of request.

        Returns aiohttp.protocol.HttpVersion instance.
        )rh   r   rJ   rJ   rK   r     r   zBaseRequest.versionc                 C   sh   | j jtj}|dur|S | j}|du rdS t|tr0t|dkr*d|d  dS t	|d S t	|S )a  Hostname of the request.

        Hostname is resolved in this order:

        - overridden value by .clone(host=new_host) call.
        - HOST HTTP header
        - local socket address the request arrived on
          (transport ``sockname``)
        - empty string if no transport information is available

        For example, 'example.com' or 'localhost:8080'.

        For historical reasons, the port number may be included.
        NrO      rM   r   ])
rb   rB   getr   HOSTr   r   r   r   rF   )r   rw   r   rJ   rJ   rK   rw     s   
zBaseRequest.hostc                 C   s6   | j du rdS t| j ttfrt| j d S t| j S )zRemote IP of client initiated HTTP request.

        The IP is resolved in this order:

        - overridden value by .clone(remote=new_remote) call.
        - peername of opened socket
        Nr   )rr   r   listr   rF   r   rJ   rJ   rK   rx     s
   
	
zBaseRequest.remotec                 C   s   t j| j| jd| jS )zThe full URL of the request.)rv   	authority)r   buildrv   rw   joinri   r   rJ   rJ   rK   r     s   zBaseRequest.urlc                 C      | j jS )z_The URL including *PATH INFO* without the host or scheme.

        E.g., ``/app/blog``
        )ri   r   r   rJ   rJ   rK   r        zBaseRequest.pathc                 C   r   )zXThe URL including PATH_INFO and the query string.

        E.g, /app/blog?id=10
        )rF   ri   r   rJ   rJ   rK   path_qs  s   
zBaseRequest.path_qsc                 C   r   )zThe URL including raw *PATH INFO* without the host or scheme.

        Warning, the path is unquoted and may contains non valid URL characters

        E.g., ``/my%2Fpath%7Cwith%21some%25strange%24characters``
        )rb   r   r   rJ   rJ   rK   raw_path  s   zBaseRequest.raw_pathMultiMapping[str]c                 C   r   )z7A multidict with all the variables in the query string.)ri   queryr   rJ   rJ   rK   r        zBaseRequest.queryc                 C   r   )z:The query string in the URL.

        E.g., id=10
        )ri   query_stringr   rJ   rJ   rK   r     r   zBaseRequest.query_stringc                 C   r   )z4A case-insensitive multidict proxy with all headers.)rf   r   rJ   rJ   rK   rB        zBaseRequest.headersc                 C   r   )z$A sequence of pairs for all headers.)rb   r   r   rJ   rJ   rK   r     r   zBaseRequest.raw_headersc                 C      t | jtjS )zyThe value of If-Modified-Since HTTP header, or None.

        This header is represented as a `datetime` object.
        )r"   rB   r   r   IF_MODIFIED_SINCEr   rJ   rJ   rK   if_modified_since     zBaseRequest.if_modified_sincec                 C   r   )z{The value of If-Unmodified-Since HTTP header, or None.

        This header is represented as a `datetime` object.
        )r"   rB   r   r   IF_UNMODIFIED_SINCEr   rJ   rJ   rK   if_unmodified_since  r   zBaseRequest.if_unmodified_sinceetag_headerc                 c   s`    | t krtdt dV  dS t| D ]}|ddd\}}}|r$ dS tt||dV  qdS )z'Extract `ETag` objects from raw header.F)is_weakr   r   r   r   N)r   r   r   finditerr   bool)r   r   r   r   garbagerJ   rJ   rK   _etag_values&  s   
zBaseRequest._etag_valuesheader_valuec                 C   s   |sd S t | |S rP   )r   r   )clsr   rJ   rJ   rK   _if_match_or_none_impl;  s   z"BaseRequest._if_match_or_none_implc                 C      |  | jtjS )zxThe value of If-Match HTTP header, or None.

        This header is represented as a `tuple` of `ETag` objects.
        )r   rB   r   r   IF_MATCHr   rJ   rJ   rK   if_matchD     zBaseRequest.if_matchc                 C   r   )z}The value of If-None-Match HTTP header, or None.

        This header is represented as a `tuple` of `ETag` objects.
        )r   rB   r   r   IF_NONE_MATCHr   rJ   rJ   rK   if_none_matchL  r   zBaseRequest.if_none_matchc                 C   r   )zpThe value of If-Range HTTP header, or None.

        This header is represented as a `datetime` object.
        )r"   rB   r   r   IF_RANGEr   rJ   rJ   rK   if_rangeT  r   zBaseRequest.if_rangec                 C   s
   | j j S )zIs keepalive enabled by client?)rb   should_closer   rJ   rJ   rK   
keep_alive\  r   zBaseRequest.keep_alivec                 C   s&   t | jtjd}tdd |D S )zMReturn request cookies.

        A read-only dictionary-like object.
        rO   c                 S   s   i | ]\}}||j qS rJ   )r   )rR   r>   morselrJ   rJ   rK   
<dictcomp>k  s    z'BaseRequest.cookies.<locals>.<dictcomp>)r   rB   r   r   COOKIEr   )r   parsedrJ   rJ   rK   cookiesa  s   zBaseRequest.cookiesc                 C   s   | j tj}d\}}|durjzd}t||tjd \}}W n ty*   tdw |r1t	|nd}|r9t	|nd}|du rH|durH| }d}|dur\|dur\|d7 }||kr\td||  u ridu rjtd t
||dS )	zMThe content of Range HTTP header.

        Return a slice instance.

        )NNNz^bytes=(\d*)-(\d*)$r   zrange not in acceptable formatr   zstart cannot be after endz"No start or end of range specified)rf   r   r   RANGErefindallASCII
IndexError
ValueErrorintslice)r   rngstartendpatternrJ   rJ   rK   
http_rangem  s,   zBaseRequest.http_rangec                 C   r   )zReturn raw payload stream.)re   r   rJ   rJ   rK   content  r   zBaseRequest.contentc                 C   s   t jdtdd | j  S )@Return True if request's HTTP BODY can be read, False otherwise.z$Deprecated, use .can_read_body #2005r   r   )r   r   r   re   at_eofr   rJ   rJ   rK   has_body  s   zBaseRequest.has_bodyc                 C   s   | j   S )r  )re   r  r   rJ   rJ   rK   can_read_body  s   zBaseRequest.can_read_bodyc                 C   s   t | jtuS )z6Return True if request has HTTP BODY, False otherwise.)typere   r*   r   rJ   rJ   rK   body_exists  s   zBaseRequest.body_existsc                    s.   | j  s| j  I dH  | j  rdS dS )zKRelease request.

        Eat unread part of HTTP BODY if present.
        N)re   r  readanyr   rJ   rJ   rK   release  s   
zBaseRequest.releasec                    s|   | j du r;| jr| j| j t }	 | j I dH }|| | jr2t|}|| jkr2t| j|s5nqt	|| _ | j S )z_Read request body if present.

        Returns bytes object with full request content.
        N)
rk   ro   re   set_read_chunk_size	bytearrayr  extendr   r1   bytes)r   bodychunk	body_sizerJ   rJ   rK   read  s"   




	zBaseRequest.readc                    s$   |   I dH }| jpd}||S )z1Return BODY as text using encoding from .charset.Nr   )r'  charsetdecode)r   
bytes_bodyencodingrJ   rJ   rK   text  s   

zBaseRequest.text)loadsr-  c                   s   |   I dH }||S )zReturn BODY as JSON.N)r,  )r   r-  r$  rJ   rJ   rK   json  s   zBaseRequest.jsonc                    s$   t | j| j| j| jj| jjtdS )z3Return async iterator to process BODY as multipart.)rt   max_field_sizemax_headersmax_size_error_cls)r)   rf   re   ro   rc   r/  r0  r1   r   rJ   rJ   rK   	multipart  s   zBaseRequest.multipartMultiDictProxy[_Post]c                    s  | j dur	| j S | j| jvrtt | _ | j S | j}|dvr(tt | _ | j S t }|dkr`|  I dH }| j}d}| I dH  }dur_|j	
tj}t|trP|jdu r^td|jr| jdtjI dH }|jtdI dH  }	r||	2 z33 dH W }
| jd|j|
I dH  |t|
7 }d|  k r|k rn q|| jd|jI dH  t|q|6 |jtdI dH  }	sw| jd|jdI dH  |du rd}t|j|jtt j!|||j	}|"|j| not# }| I dH  }	r|t|	7 }d|  k r|k rt| |$|	 | I dH  }	st# }||2 z3 dH W }|$| q6 |du s7|%drH|j&d	d
}|"|j|'| n|"|j| ntd| I dH  }dusHn| ( I dH }|r| j)pod	}|$t*|+ '|d|d t|| _ | j S )zReturn POST parameters.N)rO   z!application/x-www-form-urlencodedmultipart/form-datar4  r   zMultipart field missing name.)sizezapplication/octet-streamztext/r   )defaultz8To decode nested multipart you need to use custom readerT)keep_blank_valuesr+  ),rj   rg   POST_METHODSr   r   rA   r2  ro   nextrB   r   r   CONTENT_TYPEr   r(   r>   r  r?   rp   run_in_executortempfileTemporaryFile
read_chunkr   decode_iterwriter   closer1   seekr5   r   rH   rI   r   r!  r"  
startswithget_charsetr)  r'  r(  r   rstrip)r   rA   outr2  max_sizer5  fieldfield_cttmpr%  decoded_chunkffraw_datar   dr(  datarJ   rJ   rK   post  s   




	

>
zBaseRequest.postr>   r6  c                 C   s0   | j }|du r	|S |j}|du r|S |||S )z"Extra info from protocol transportN)rc   r   get_extra_info)r   r>   r6  r{   r   rJ   rJ   rK   rQ  A  s   zBaseRequest.get_extra_infoc                 C   s2   | j ddd}d| jj d| j d| dS )Nasciibackslashreplace< z >)r   r   r)  r   rC   rg   )r   ascii_encodable_pathrJ   rJ   rK   __repr__M  s   zBaseRequest.__repr__otherc                 C   s   t | t |kS rP   )id)r   rX  rJ   rJ   rK   __eq__S     zBaseRequest.__eq__c                 C   s   dS )NTrJ   r   rJ   rJ   rK   __bool__V  r   zBaseRequest.__bool__responsec                    s   d S rP   rJ   )r   r]  rJ   rJ   rK   _prepare_hookY  s   zBaseRequest._prepare_hookexcc                 C   s   t | j| d S rP   )r%   re   )r   r_  rJ   rJ   rK   _cancel\  r[  zBaseRequest._cancelc                 C   sD   | j d u s
| jdkrd S | j  D ]\}}t|tr|j  qd S )Nr4  )rj   rA   r   r   r5   r@   rA  )r   	file_namefile_field_objectrJ   rJ   rK   _finish_  s   

zBaseRequest._finish)r   r~   )r   r8   )r   r   )r   N)r   r3  rP   )trC   rD   rE   r   
METH_PATCH	METH_POSTMETH_PUT
METH_TRACEMETH_DELETEr8  r    ATTRS	frozensetrj   r   _PostrG   rk   r#  setrs   rF   r&   r+   r   asyncioAbstractEventLoopr  dictr!   r   r   r$   r   r0   r.   r   propertyr}   r{   	Transportr   r   rt   r#   ry   r   r   r   r   r:   r   r   r   r   r   r   r   r   r   r   r   rv   r   r'   r   rw   rx   r   r   r   r   r   r   r   rB   r/   r   datetimer   r   staticmethodr   r   classmethodr   r   r   r  r  r	  r  r  r  r  r  r  r  r'  r,  r,   r-   r.  r)   r2  rP  rQ  rW  objectrZ  r\  r3   r^  BaseExceptionr`  rc  rJ   rJ   rJ   rK   r4   k   sV  
 	

;	

; <	#

dr4   c                       s   e Zd ZU ejedgB ZdZed ed< e	r$de
deddf fddZeeeeeeed	d
e
eB deeB deeB de
eB de
eB de
eB deeB dd f fddZedddZedddZedefddZdeddfddZ  ZS )r6   _match_infoNr9   r>   valr   c                    s>   || j vrtjd| jj d| dtdd t || d S )NzSetting custom .z attribute is discouragedr   r   )ri  r   r   r   rC   r   super__setattr__)r   r>   rx  r   rJ   rK   r{  t  s   
zRequest.__setattr__r   r   r   rB   rv   rw   rx   rt   c          
   	      s0   t  j|||||||d}tt|}	| j|	_|	S )Nr   )rz  r   r   r6   rw  )
r   r   r   rB   rv   rw   rx   rt   retnew_retr|  rJ   rK   r   ~  s   
	zRequest.clonec                 C   s   | j }|dus	J |S )zResult of route resolving.N)rw  r   
match_inforJ   rJ   rK   r    s   zRequest.match_infor7   c                 C   s   | j }|dus	J |jS )zApplication instance.N)rw  current_appr  rJ   rJ   rK   app  s   zRequest.appc                 C   sH   | j }|d us	J |j}| j}||}tt|d |d  }t|S )Nr   )rw  appsr  indexr   reversedr   )r   r  lstr  idxsublistrJ   rJ   rK   config_dict  s   
zRequest.config_dictr]  c                    s@   | j }|d u r
d S |jD ]}|j }r|| |I d H  qd S rP   )rw  _appson_response_preparesend)r   r]  r  r  r  rJ   rJ   rK   r^    s   

zRequest._prepare_hook)r   r9   )r   r7   )rC   rD   rE   r4   ri  rj  rw  r
   rG   r   rF   r   r{  r$   r   r0   r.   r  r   r#   r  rp  r  r   r  r3   r^  __classcell__rJ   rJ   r|  rK   r6   l  sH   
 	
	r6   )jrm  rr  rH   r  stringr<  r   r   collections.abcr   r   r   r   r   typingr   r   r	   r
   r   r   r   urllib.parser   attr	multidictr   r   r   r   r   yarlr   rO   r   _cookie_helpersr   abcr   helpersr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   http_parserr&   http_writerr'   r2  r(   r)   streamsr*   r+   typedefsr,   r-   r.   r/   r0   web_exceptionsr1   r2   web_responser3   __all__web_appr7   web_protocolr8   web_urldispatcherr9   r:   sr5   rF   r#  r!  rk  digitsascii_lettersrL   rG   rN   formatr   r   rangerZ   r[   r]   r_   compiler`   ra   r4   r6   rJ   rJ   rJ   rK   <module>   sl   
 $< $"      