bg ddlZddlmZmZmZmZddlmZmZddl m Z m Z ddl m Z ddlmZddlmZd Zerdd lmZed Zd e d edeee ffdZdedefdZddde ddedededee def dZdddefdZdS)N) TYPE_CHECKINGTupleTypeTypeVar)Handler Middleware)HTTPMoveHTTPPermanentRedirect)Request)StreamResponse) SystemRoute) middlewarenormalize_path_middleware) Application_FuncrequestpathreturncK||}|jj|d{V}||_|jd|fSd|fS)N)rel_urlTF)cloneapprouterresolve _match_infohttp_exception)rr alt_request match_infos N/opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/web_middlewares.py_check_request_resolvesr!si-----K{)11+>>>>>>>>J(K ([  '>fcd|_|S)Nr)__middleware_version__)r#s r rr!s A Hr"TF) append_slash remove_slash merge_slashesredirect_classr&r'r(r)co }|s Jdtdtdtdtffd }|S)aFactory for producing a middleware that normalizes the path of a request. Normalizing means: - Add or remove a trailing slash to the path. - Double slashes are replaced by one. The middleware returns as soon as it finds a path that resolves correctly. The order if both merge and append/remove are enabled is 1) merge slashes 2) append/remove slash 3) both merge slashes and append/remove slash. If the path resolves with at least one of those conditions, it will redirect to the new path. Only one of `append_slash` and `remove_slash` can be enabled. If both are `True` the factory will raise an assertion error If `append_slash` is `True` the middleware will append a slash when needed. If a resource is defined with trailing slash and the request comes without it, it will append it automatically. If `remove_slash` is `True`, `append_slash` must be `False`. When enabled the middleware will remove trailing slashes and redirect if the resource is defined If merge_slashes is True, merge multiple consecutive slashes in the path into one. z#Cannot both remove and append slashrhandlerrcjKt|jjtrg}d|jvr$|jdd\}}d|z}n d}|j}r)|tjdd|r2|j ds||dz r7|j dr||ddr.r,|tjdd|dzr5 r3tjdd|}||dd|D]F}tjdd|}t||d{V\}}|r |j|zG||d{VS)N?rz//+/z^//+) isinstancerrouterraw_pathsplitappendresubrendswithr!) rr+paths_to_checkrquerymerged_slashesresolvesr&r(r)r's r implz'normalize_path_middleware..implLs g(. < < CNg&&&%.44S!<< ee ' @%%bfUC&>&>??? 2GL$9$9#$>$> 2%%dSj111 1 5 5c : : 1%%d3B3i000 F F%%bfUC&D&DEEE ; ;!#sD!9!9%%nSbS&9:::& C Cvfc400*A'4*P*P$P$P$P$P$P$P!'C(.)9E)ABBBCWW%%%%%%%%%r"rr rr )r&r'r(r)correct_configurationr=s```` r rr&sF".!>,? GG"GGG &G&g&.&&&&&&&&Z&< Kr"rrcXtdtdtdtffd }|S)Nrr+rcK|j5||d{VcdddS#1swxYwYdS)N)rset_current_app)rr+rs r r=z&_fix_request_current_app..implos   / / 4 4 * * )))))))) * * * * * * * * * * * * * * * * * *s<AAr>)rr=s` r _fix_request_current_apprCnsG*G*g*.*****Z* Kr")r6typingrrrrtypedefsrr web_exceptionsr r web_requestr web_responser web_urldispatcherr__all__web_apprrstrboolr!rrrCr"r rOs 666666666666))))))));;;;;;;; ((((((******  %$$$$$$ 7 # %g BV     % E    %: EEEEE E N E  EEEEP-Jr"