ó
    ã¾yj T  ã                   óò   • S r SSKJrJrJr  SSKJr  SSKrSSKrSSK	r	/ SQr
/ SQr/ SQrS	 r1 S
kR                  rS rS r " S S5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)z/Base classes for server/gateway implementationsé   )ÚFileWrapperÚguess_schemeÚis_hop_by_hop)ÚHeadersé    N)ÚBaseHandlerÚSimpleHandlerÚBaseCGIHandlerÚ
CGIHandlerÚIISCGIHandlerÚread_environ)ÚMonÚTueÚWedÚThuÚFriÚSatÚSun)NÚJanÚFebÚMarÚAprÚMayÚJunÚJulÚAugÚSepÚOctÚNovÚDecc           	      ój   • [         R                  " U 5      u	  pp4pVpxn	S[        U   U[        U   XXV4-  $ )Nz#%s, %02d %3s %4d %02d:%02d:%02d GMT)ÚtimeÚgmtimeÚ_weekdaynameÚ
_monthname)
Ú	timestampÚyearÚmonthÚdayÚhhÚmmÚssÚwdÚyÚzs
             Ú'/usr/lib/python3.13/wsgiref/handlers.pyÚformat_date_timer1      sB   € Ü-1¯[ª[¸Ó-CÑ*€D�˜" "¨Ø0Ü�RÑ˜#œz¨%Ñ0°$¸Bð4ñ ð ó    >
   ÚHTTPSÚ	AUTH_TYPEÚ	PATH_INFOÚREMOTE_USERÚSCRIPT_NAMEÚCONTENT_TYPEÚQUERY_STRINGÚREMOTE_IDENTÚCONTENT_LENGTHÚREQUEST_METHODc                 óÒ   • [        U 5      =(       dV    U R                  S5      =(       d>    U R                  S5      =(       d&    U R                  S5      =(       a    [        U SS  5      $ )NÚHTTP_ÚSSL_Ú	REDIRECT_é	   )Ú_is_requestÚ
startswithÚ_needs_transcode)Úks    r0   rD   rD      sT   € Ü�q‹>÷ C˜QŸ\™\¨'Ó2÷ C°a·l±lÀ6Ó6J÷ CØ�L‰L˜Ó%×AÔ*:¸1¸Q¸R¸5Ó*AðCr2   c                  ó  • [         R                  " 5       n Sn SR                  SU5        0 n[        R
                  R                  5        GH*  u  p4[        U5      (       Ga  [         R                  S:X  aÛ  [        R
                  R                  SS5      R                  5       nUR                  S5      (       a!  UR                  S5      R                  S5      nO–UR                  S	5      (       a  OUR                  S
5      (       a'  SU;   a!  UR                  S5      R                  S5      nOBUR                  U S5      R                  S5      nO UR                  X5      R                  S5      nXBU'   GM-     U$ ! [         a    Sn GN`f = f)z'Read environment, fixing HTTP variablesÚsurrogateescapeÚ zutf-8ÚreplaceÚwin32ÚSERVER_SOFTWAREzmicrosoft-iis/ú
iso-8859-1zapache/zsimplehttp/zpython/3)ÚsysÚgetfilesystemencodingÚencodeÚLookupErrorÚosÚenvironÚitemsrD   ÚplatformÚgetÚlowerrC   Údecode)ÚencÚescrR   rE   ÚvÚsoftwares         r0   r   r   "   sW  € ä
×
#Ò
#Ó
%€CØ
€CðØ
�	‰	�'˜3Ôð €Gô
 —
‘
× Ñ ×"‰ˆÜ˜A×Òô �|‰|˜wÓ&ÜŸ:™:Ÿ>™>Ð*;¸RÓ@×FÑFÓH�ð ×&Ñ&Ð'7×8Ñ8ØŸ™ Ó)×0Ñ0°Ó>‘Að ×(Ñ(¨×3Ñ3Øð ×'Ñ'¨×6Ñ6Ø" hÓ.àŸ™ Ó)×0Ñ0°Ó>‘Að Ÿ™  iÓ0×7Ñ7¸ÓE‘Að
 —H‘H˜SÓ&×-Ñ-¨lÓ;�à�Œ
ñW #ðX €Nøôg ó Ø‹ðús   ™E< Å<FÆFc                   ó
  • \ rS rSrSrSrSrSrSrSr	Sr
Sr\" 5       r\r\rSrSrS	/rS
rS=rrSrSrSrS rS rS rS rS rS r S&S jr!S r"S r#S r$S r%S r&S r'S r(S r)S r*S r+S r,S r-S r.S  r/S! r0S" r1S# r2S$ r3S%r4g)'r   é^   z+Manage the invocation of a WSGI application)r   r   TFz1.0Nz500 Internal Server Error)zContent-Typez
text/plains;   A server error occurred.  Please contact the administrator.r   c                 ó  •  U R                  5         U" U R                  U R                  5      U l        U R	                  5         g! [
        [        [        4 a     g   U R                  5          g!   U R                  5         e = f= f)zInvoke the applicationN)
Úsetup_environrR   Ústart_responseÚresultÚfinish_responseÚConnectionAbortedErrorÚBrokenPipeErrorÚConnectionResetErrorÚhandle_errorÚclose)ÚselfÚapplications     r0   ÚrunÚBaseHandler.run€   sv   € ð	Ø×ÑÔ Ù% d§l¡l°D×4GÑ4GÓHˆDŒKØ× Ñ Õ"øÜ&¬Ô9MÐNó 	ñ ð	ðØ×!Ñ!Ö#øðà—
‘
”Øýs$   ‚AA ÁBÁBÁA0Á0BÂBc                 ó  • U R                   R                  5       =ol        U R                  5         U R	                  5       US'   U R                  5       US'   U R                  US'   U R                  US'   U R                  5       US'   U R                  US'   U R                  US'   U R                  b  U R                  US	'   U R                  (       a/  U R                  (       a  UR                  S
U R                  5        ggg)z&Set up the environment for one requestz
wsgi.inputzwsgi.errorszwsgi.versionzwsgi.run_oncezwsgi.url_schemezwsgi.multithreadzwsgi.multiprocessNzwsgi.file_wrapperrK   )Ú
os_environÚcopyrR   Úadd_cgi_varsÚ	get_stdinÚ
get_stderrÚwsgi_versionÚwsgi_run_onceÚ
get_schemeÚwsgi_multithreadÚwsgi_multiprocessÚwsgi_file_wrapperÚorigin_serverÚserver_softwareÚ
setdefault)rh   Úenvs     r0   r_   ÚBaseHandler.setup_environ˜   sè   € ð "Ÿ_™_×1Ñ1Ó3Ð3ˆŒlØ×ÑÔà#'§>¡>Ó#3ˆˆLÑØ#'§?¡?Ó#4ˆˆMÑØ#'×#4Ñ#4ˆˆNÑØ#'×#5Ñ#5ˆˆOÑØ#'§?¡?Ó#4ˆÐÑØ#'×#8Ñ#8ˆÐÑØ#'×#9Ñ#9ˆÐÑ à×!Ñ!Ñ-Ø'+×'=Ñ'=ˆCÐ#Ñ$à×× $×"6×"6Ø�N‰NÐ,¨T×-AÑ-AÕBð #7Ðr2   c                 óX  •  U R                  5       (       a  U R                  5       (       d4  U R                   H  nU R                  U5        M     U R	                  5         U R                  5         g!   [        U R                  S5      (       a  U R                  R                  5         e = f)a  Send any iterable data, then close self and the iterable

Subclasses intended for use in asynchronous servers will
want to redefine this method, such that it sets up callbacks
in the event loop to iterate over the data, and to call
'self.close()' once the response is finished.
rg   N)Úresult_is_fileÚsendfilera   ÚwriteÚfinish_contentrg   Úhasattr©rh   Údatas     r0   rb   ÚBaseHandler.finish_response­   s~   € ð	Ø×&Ñ&×(Ñ(°·±·±Ø ŸKœK�DØ—J‘J˜tÖ$ñ (à×#Ñ#Ô%ð �J‰J�Løð	ô �t—{‘{ G×,Ñ,Ø—‘×!Ñ!Ô#Øús   ‚AA1 Á18B)c                 ó,   • [        U R                  5      $ )z Return the URL scheme being used)r   rR   ©rh   s    r0   rt   ÚBaseHandler.get_schemeÇ   s   € ä˜DŸL™LÓ)Ð)r2   c                 ó¸   •  [        U R                  5      nUS:X  a#  [        U R                  5      U R                  S'   gg! [
        [        [        4 a     gf = f)z@Compute Content-Length or switch to chunked encoding if possibler   úContent-LengthN)Úlenra   ÚstrÚ
bytes_sentÚheadersÚ	TypeErrorÚAttributeErrorÚNotImplementedError)rh   Úblockss     r0   Úset_content_lengthÚBaseHandler.set_content_lengthÌ   sZ   € ð	Ü˜Ÿ™Ó%ˆFð �q‹yÜ14°T·_±_Ó1E�—‘Ð-Ñ.Øð øô œ.Ô)<Ð=ó 	Ùð	ús   ‚A ÁAÁAc                 óF   • SU R                   ;  a  U R                  5         gg)zaMake any necessary header changes or defaults

Subclasses can extend this to add other defaults.
rŠ   N)rŽ   r“   r‡   s    r0   Úcleanup_headersÚBaseHandler.cleanup_headersÙ   s!   € ð
  4§<¡<Ó/Ø×#Ñ#Õ%ð 0r2   c                 ó®  • U(       a   U R                   (       a  e  SnOU R                  b  [        S5      eXl        U R	                  U5      U l        U R                  US5      nU R                  U5         U HG  u  pEU R                  US5      nU R                  US5      n[        U5      (       d  M;   SU SU S35       e   U R                  $ ! Snf = f)	z4'start_response()' callable as specified by PEP 3333NzHeaders already set!ÚStatuszHeader namezHeader valuezHop-by-hop header, 'z: z', not allowed)	Úheaders_sentrŽ   ÚAssertionErrorÚstatusÚheaders_classÚ_convert_string_typeÚ_validate_statusr   r€   )rh   rœ   rŽ   Úexc_infoÚnameÚvals         r0   r`   ÚBaseHandler.start_responseá   så   € ö ð Ø×$×$Øð %ð  ‘Ø�\‰\Ñ%Ü Ð!7Ó8Ð8àŒØ×)Ñ)¨'Ó2ˆŒØ×*Ñ*¨6°8Ó<ˆØ×Ñ˜fÔ%àÛ$‘	�Ø×0Ñ0°°}ÓE�Ø×/Ñ/°°^ÓD�Ü(¨×.Ó.ð JØ-¨d¨V°2°c°U¸.ÐIóJÐ.ñ %ð �z‰zÐøð!  ‘ús   ‰C ÃCc                 ó¦   • [        U5      S:  a  [        S5      eUS S R                  5       (       d  [        S5      eUS   S:w  a  [        S5      eg )Né   z$Status must be at least 4 charactersé   z(Status message must begin w/3-digit codeÚ z+Status message must have a space after code)r‹   r›   Úisdigit)rh   rœ   s     r0   rŸ   ÚBaseHandler._validate_statusû   sW   € Üˆv‹;˜‹?Ü Ð!GÓHÐHØ�b�qˆz×!Ñ!×#Ñ#Ü Ð!KÓLÐLØ�!‰9˜ÓÜ Ð!NÓOÐOð r2   c                 ór   • [        U5      [        L a  U$ [        SR                  U[	        U5      5      5      e)zConvert/check value type.z!{0} must be of type str (got {1}))ÚtyperŒ   r›   ÚformatÚrepr)rh   ÚvalueÚtitles      r0   rž   Ú BaseHandler._convert_string_type  s4   € ä�‹;œ#ÒØˆLÜØ/×6Ñ6°u¼dÀ5»kÓJó
ð 	
r2   c                 óf  • U R                   (       aó  U R                  5       (       aÝ  U R                  SU R                  < SU R                  < S3R                  S5      5        SU R                  ;  a?  U R                  S[        [        R                  " 5       5      -  R                  S5      5        U R                  (       a?  SU R                  ;  a.  U R                  SU R                  -  R                  S5      5        g
g
g
g
U R                  S	U R                  -  R                  S5      5        g
)z6Transmit version/status/date/server, via self._write()zHTTP/r§   z
rL   ÚDatez
Date: %s
ÚServerzServer: %s
zStatus: %s
N)
rx   Úclient_is_modernÚ_writeÚhttp_versionrœ   rO   rŽ   r1   r"   ry   r‡   s    r0   Úsend_preambleÚBaseHandler.send_preamble  sä   € à××Ø×$Ñ$×&Ñ&Ø—’°×1BÔ1BÀ4Ç;Ä;ÐO×WÑWÐXdÓeÔfØ §¡Ó-Ø—K‘KØ'Ô*:¼4¿9º9»;Ó*GÑG×OÑOÐP\Ó]ôð ×'×'¨H¸D¿L¹LÓ,HØ—K‘KÐ!1°D×4HÑ4HÑ!H× PÑ PÐQ]Ó ^Õ_ð -IÐ'ð 'ð �K‰KÐ)¨D¯K©KÑ7×?Ñ?ÀÓMÕNr2   c                 óP  • [        U5      [        L d   S5       eU R                  (       d  [        S5      eU R                  (       d!  [        U5      U l        U R                  5         OU =R                  [        U5      -  sl        U R                  U5        U R                  5         g)z+'write()' callable as specified by PEP 3333z)write() argument must be a bytes instancezwrite() before start_response()N)
r«   Úbytesrœ   r›   rš   r‹   r�   Úsend_headersrµ   Ú_flushrƒ   s     r0   r€   ÚBaseHandler.write  s~   € ô �D‹zœUÒ"ð 	8Ø7ó	8Ð"ð �{�{Ü Ð!BÓCÐCà×"×"ä! $›iˆDŒOØ×ÑÕà�OŠOœs 4›yÑ(�Oð 	�‰�DÔØ�‰�r2   c                 ó   • g)a«  Platform-specific file transmission

Override this method in subclasses to support platform-specific
file transmission.  It is only called if the application's
return iterable ('self.result') is an instance of
'self.wsgi_file_wrapper'.

This method should return a true value if it was able to actually
transmit the wrapped file-like object using a platform-specific
approach.  It should return a false value if normal iteration
should be used instead.  An exception can be raised to indicate
that transmission was attempted, but failed.

NOTE: this method should call 'self.send_headers()' if
'self.headers_sent' is false and it is going to attempt direct
transmission of the file.
F© r‡   s    r0   r   ÚBaseHandler.sendfile.  s   € ð$ r2   c                 ó€   • U R                   (       d-  U R                  R                  SS5        U R                  5         gg)z.Ensure headers and content have both been sentrŠ   Ú0N)rš   rŽ   rz   r»   r‡   s    r0   r�   ÚBaseHandler.finish_contentC  s1   € à× × ð �L‰L×#Ñ#Ð$4°cÔ:Ø×ÑÕàr2   c                 ó"  •  [        U R                  S5      (       a  U R                  R                  5         S=U l        =U l        =U l        U l        SU l        SU l        g! S=U l        =U l        =U l        U l        SU l        SU l        f = f)ztClose the iterable (if needed) and reset all instance vars

Subclasses may want to also drop the client connection.
rg   Nr   F)r‚   ra   rg   rŽ   rœ   rR   r�   rš   r‡   s    r0   rg   ÚBaseHandler.closeM  s‚   € ð
	;Ü�t—{‘{ 7×+Ñ+Ø—‘×!Ñ!Ô#àFJÐJˆDŒKÐJ˜$œ,ÐJ¨¬°t´|ØˆDŒO°U Õ!2øð GKÐJˆDŒKÐJ˜$œ,ÐJ¨¬°t´|ØˆDŒO°U Õ!2ús   ‚5A" Á",Bc                 óè   • U R                  5         SU l        U R                  (       a  U R                  5       (       a5  U R	                  5         U R                  [        U R                  5      5        gg)z1Transmit headers to the client, via self._write()TN)r–   rš   rx   r´   r·   rµ   rº   rŽ   r‡   s    r0   r»   ÚBaseHandler.send_headersZ  sS   € à×ÑÔØ ˆÔØ×!×! T×%:Ñ%:×%<Ñ%<Ø×ÑÔ Ø�K‰Kœ˜dŸl™lÓ+Õ,ð &=r2   c                 ó\   • U R                   nUSL=(       a    [        U R                  U5      $ )z@True if 'self.result' is an instance of 'self.wsgi_file_wrapper'N)rw   Ú
isinstancera   )rh   Úwrappers     r0   r~   ÚBaseHandler.result_is_filec  s(   € à×(Ñ(ˆØ˜dÐ"×F¤z°$·+±+¸gÓ'FÐFr2   c                 óB   • U R                   S   R                  5       S:g  $ )z,True if client can accept status and headersÚSERVER_PROTOCOLzHTTP/0.9)rR   Úupperr‡   s    r0   r´   ÚBaseHandler.client_is_moderni  s    € à�|‰|Ð-Ñ.×4Ñ4Ó6¸*ÑDÐDr2   c                 ó¢   •  SSK Jn  U R                  5       nU" US   US   US   U R                  U5        UR	                  5         Sng! Snf = f)zqLog the 'exc_info' tuple in the server log

Subclasses may override to retarget the output or change its format.
r   )Úprint_exceptionr   é   N)Ú	tracebackrÑ   rq   Útraceback_limitÚflush)rh   r    rÑ   Ústderrs       r0   Úlog_exceptionÚBaseHandler.log_exceptionn  sR   € ð
		Ý1Ø—_‘_Ó&ˆFÙØ˜‘˜X a™[¨(°1©+Ø×$Ñ$ fôð �L‰LŒNà‰Hø�t‰Hús   ‚AA
 Á
Ac                 óæ   • U R                  [        R                  " 5       5        U R                  (       d<  U R	                  U R
                  U R                  5      U l        U R                  5         gg)z>Log current error, and send error output to client if possibleN)	r×   rM   r    rš   Úerror_outputrR   r`   ra   rb   r‡   s    r0   rf   ÚBaseHandler.handle_error~  sN   € à×Ñœ3Ÿ<š<›>Ô*Ø× × Ø×+Ñ+¨D¯L©L¸$×:MÑ:MÓNˆDŒKØ× Ñ Õ"ð !r2   c                 ó„   • U" U R                   U R                  SS [        R                  " 5       5        U R                  /$ )a  WSGI mini-app to create error output

By default, this just uses the 'error_status', 'error_headers',
and 'error_body' attributes to generate an output page.  It can
be overridden in a subclass to dynamically generate diagnostics,
choose an appropriate message for the user's preferred language, etc.

Note, however, that it's not recommended from a security perspective to
spit out diagnostics to any old user; ideally, you should have to do
something special to enable diagnostic output, which is why we don't
include any here!
N)Úerror_statusÚerror_headersrM   r    Ú
error_body)rh   rR   r`   s      r0   rÚ   ÚBaseHandler.error_output†  s4   € ñ 	�t×(Ñ(¨×);Ñ);¹AÐ)>¼s¿|º|»~ÔNØ—‘Ð Ð r2   c                 ó   • [         e)z÷Override in subclass to buffer data for send to client

It's okay if this method actually transmits the data; BaseHandler
just separates write and flush operations for greater efficiency
when the underlying system actually has such a distinction.
©r‘   rƒ   s     r0   rµ   ÚBaseHandler._write™  s
   € ô "Ð!r2   c                 ó   • [         e)z”Override in subclass to force sending of recent '_write()' calls

It's okay if this method is a no-op (i.e., if '_write()' actually
sends the data.
râ   r‡   s    r0   r¼   ÚBaseHandler._flush¢  s
   € ô "Ð!r2   c                 ó   • [         e)z4Override in subclass to return suitable 'wsgi.input'râ   r‡   s    r0   rp   ÚBaseHandler.get_stdinª  ó   € ä!Ð!r2   c                 ó   • [         e)z5Override in subclass to return suitable 'wsgi.errors'râ   r‡   s    r0   rq   ÚBaseHandler.get_stderr®  rè   r2   c                 ó   • [         e)z>Override in subclass to insert CGI variables in 'self.environ'râ   r‡   s    r0   ro   ÚBaseHandler.add_cgi_vars²  rè   r2   )r�   rR   rŽ   rš   ra   rœ   ©N)5Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rr   ru   rv   rs   rx   r¶   ry   r   rm   r   rw   r   r�   rÔ   rÝ   rÞ   rß   rœ   ra   rš   rŽ   r�   rj   r_   rb   rt   r“   r–   r`   rŸ   rž   r·   r€   r   r�   rg   r»   r~   r´   r×   rf   rÚ   rµ   r¼   rp   rq   ro   Ú__static_attributes__r¿   r2   r0   r   r   ^   sø   † Ù5ð €LØÐØÐØ€Mà€MØ€LØ€Oñ
 “€Jð $ÐØ€Mð €OØ.€LØ2Ð3€MØO€Jð Ð€FˆVØ€LØ€GØ€Jòò0Cò*ò4*ò
	ò&ôò4Pò
òOòò*ò*ò
;ò-òGòEò
ò #ò!ò&"ò"ò"ò"õ"r2   r   c                   óB   • \ rS rSrSr SS jrS rS rS rS r	S r
S	rg
)r	   i·  aU  Handler that's just initialized with streams, environment, etc.

This handler subclass is intended for synchronous HTTP/1.0 origin servers,
and handles sending the entire response output, given the correct inputs.

Usage::

    handler = SimpleHandler(
        inp,out,err,env, multithread=False, multiprocess=True
    )
    handler.run(app)c                 óL   • Xl         X l        X0l        X@l        XPl        X`l        g rí   )ÚstdinÚstdoutrÖ   Úbase_envru   rv   )rh   rö   r÷   rÖ   rR   ÚmultithreadÚmultiprocesss          r0   Ú__init__ÚSimpleHandler.__init__Ä  s$   € ð Œ
ØŒØŒØŒØ +ÔØ!-Õr2   c                 ó   • U R                   $ rí   )rö   r‡   s    r0   rp   ÚSimpleHandler.get_stdinÎ  s   € Ø�z‰zÐr2   c                 ó   • U R                   $ rí   )rÖ   r‡   s    r0   rq   ÚSimpleHandler.get_stderrÑ  s   € Ø�{‰{Ðr2   c                 óN   • U R                   R                  U R                  5        g rí   )rR   Úupdaterø   r‡   s    r0   ro   ÚSimpleHandler.add_cgi_varsÔ  s   € Ø�‰×Ñ˜DŸM™MÕ*r2   c                 óî   • U R                   R                  U5      nUb  U[        U5      :X  a  g SSKJn  U" S[
        5        XS  =n(       a)  U R                   R                  U5      nXS  =n(       a  M(  g g )Nr   )Úwarnz9SimpleHandler.stdout.write() should not do partial writes)r÷   r€   r‹   Úwarningsr  ÚDeprecationWarning)rh   r„   ra   r  s       r0   rµ   ÚSimpleHandler._write×  sq   € Ø—‘×"Ñ" 4Ó(ˆØ‰>˜V¤s¨4£yÓ0ØÝ!ÙÐHÜô	 à˜7�mÐ#ˆdÕ#Ø—[‘[×&Ñ& tÓ,ˆFð ˜7�mÐ#ˆd×#Ñ#r2   c                 ón   • U R                   R                  5         U R                   R                  U l        g rí   )r÷   rÕ   r¼   r‡   s    r0   r¼   ÚSimpleHandler._flushá  s#   € Ø�‰×ÑÔØ—k‘k×'Ñ'ˆ�r2   )r¼   rø   rÖ   rö   r÷   rv   ru   N)TF)rî   rï   rð   rñ   rò   rû   rp   rq   ro   rµ   r¼   ró   r¿   r2   r0   r	   r	   ·  s*   † ñ
ð (-ô.òòò+ò-õ(r2   r	   c                   ó   • \ rS rSrSrSrSrg)r
   iæ  a¦  CGI-like systems using input/output/error streams and environ mapping

Usage::

    handler = BaseCGIHandler(inp,out,err,env)
    handler.run(app)

This handler class is useful for gateway protocols like ReadyExec and
FastCGI, that have usable input/output/error streams and an environment
mapping.  It's also the base class for CGIHandler, which just uses
sys.stdin, os.environ, and so on.

The constructor also takes keyword arguments 'multithread' and
'multiprocess' (defaulting to 'True' and 'False' respectively) to control
the configuration sent to the application.  It sets 'origin_server' to
False (to enable CGI-like output), and assumes that 'wsgi.run_once' is
False.
Fr¿   N)rî   rï   rð   rñ   rò   rx   ró   r¿   r2   r0   r
   r
   æ  s   † ñð& ƒMr2   r
   c                   ó&   • \ rS rSrSrSr0 rS rSrg)r   iþ  aÅ  CGI-based invocation via sys.stdin/stdout/stderr and os.environ

Usage::

    CGIHandler().run(app)

The difference between this class and BaseCGIHandler is that it always
uses 'wsgi.run_once' of 'True', 'wsgi.multithread' of 'False', and
'wsgi.multiprocess' of 'True'.  It does not take any initialization
parameters, but always uses 'sys.stdin', 'os.environ', and friends.

If you need to override any of these parameters, use BaseCGIHandler
instead.
Tc           
      óÂ   • [         R                  U [        R                  R                  [        R
                  R                  [        R                  [        5       SSS9  g )NFT©rù   rú   )r
   rû   rM   rö   Úbufferr÷   rÖ   r   r‡   s    r0   rû   ÚCGIHandler.__init__  s?   € Ü×ÑØ”#—)‘)×"Ñ"¤C§J¡J×$5Ñ$5´s·z±zÜ‹N¨¸Dð 	 ò 	
r2   r¿   N©	rî   rï   rð   rñ   rò   rs   rm   rû   ró   r¿   r2   r0   r   r   þ  s   † ñð €Mð €Jõ
r2   r   c                   ó&   • \ rS rSrSrSr0 rS rSrg)r   i  zÿCGI-based invocation with workaround for IIS path bug

This handler should be used in preference to CGIHandler when deploying on
Microsoft IIS without having set the config allowPathInfo option (IIS>=7)
or metabase allowPathInfoForScriptMappings (IIS<7).
Tc           
      óh  • [        5       nUR                  SS5      nUR                  SS5      nUS-   R                  US-   5      (       a  U[        U5      S  US'   [        R                  U [        R                  R                  [        R                  R                  [        R                  USSS9  g )Nr5   rH   r7   Ú/FTr  )r   rU   rC   r‹   r
   rû   rM   rö   r  r÷   rÖ   )rh   rR   ÚpathÚscripts       r0   rû   ÚIISCGIHandler.__init__4  s’   € Ü“ˆØ�{‰{˜;¨Ó+ˆØ—‘˜]¨BÓ/ˆØ�‰H× Ñ  ¨¡×,Ñ,Ø#'¬¨F«¨Ð#5ˆG�KÑ Ü×ÑØ”#—)‘)×"Ñ"¤C§J¡J×$5Ñ$5´s·z±zØ °Tð 	 ò 	
r2   r¿   Nr  r¿   r2   r0   r   r     s   † ñð €MØ€Jõ 	
r2   r   )rò   Úutilr   r   r   rŽ   r   rM   rQ   r"   Ú__all__r$   r%   r1   Ú__contains__rB   rD   r   r   r	   r
   r   r   r¿   r2   r0   Ú<module>r     s�   ðÙ 5ç :Ñ :Ý ç Ó ò€ò A€ò8€
òò÷ �,ð ò
Cò9÷xV"ñ V"ôr
,(�Kô ,(ô^�]ô ô0
�ô 
ô<!
�Nõ !
r2   