/usr/lib64/python3.12/wsgiref/__pycache__
NameSizeModeActions
handlers.cpython-312.opt-1.pyc233440644editdlrm
handlers.cpython-312.opt-2.pyc181180644editdlrm
handlers.cpython-312.pyc237820644editdlrm
headers.cpython-312.opt-1.pyc100290644editdlrm
headers.cpython-312.opt-2.pyc68940644editdlrm
headers.cpython-312.pyc101860644editdlrm
simple_server.cpython-312.opt-1.pyc81560644editdlrm
simple_server.cpython-312.opt-2.pyc74050644editdlrm
simple_server.cpython-312.pyc81560644editdlrm
types.cpython-312.opt-1.pyc36870644editdlrm
types.cpython-312.opt-2.pyc34250644editdlrm
types.cpython-312.pyc36870644editdlrm
util.cpython-312.opt-1.pyc68100644editdlrm
util.cpython-312.opt-2.pyc52820644editdlrm
util.cpython-312.pyc68100644editdlrm
validate.cpython-312.opt-1.pyc201380644editdlrm
validate.cpython-312.opt-2.pyc165160644editdlrm
validate.cpython-312.pyc201380644editdlrm
__init__.cpython-312.opt-1.pyc8080644editdlrm
__init__.cpython-312.opt-2.pyc1430644editdlrm
__init__.cpython-312.pyc8080644editdlrm
Edit: /usr/lib64/python3.12/wsgiref/__pycache__/handlers.cpython-312.pyc (23782B)
{|j1UdZddlmZmZmZddlmZmZddlZddl Z ddl Z gdZ gdZ gdZ d Zhd jZd Zd ZGd dZGddeZGddeZGddeZGddeZy)z/Base classes for server/gateway implementations) FileWrapper guess_scheme is_hop_by_hop)Headers_name_disallowed_reN) BaseHandler SimpleHandlerBaseCGIHandler CGIHandler IISCGIHandler read_environ)MonTueWedThuFriSatSun) NJanFebMarAprMayJunJulAugSepOctNovDecc ttj|\ }}}}}}}}} dt||t|||||fzS)Nz#%s, %02d %3s %4d %02d:%02d:%02d GMT)timegmtime _weekdayname _monthname) timestampyearmonthdayhhmmsswdyzs )/usr/lib64/python3.12/wsgiref/handlers.pyformat_date_timer2sN-1[[-C*D%b"b"a 0R#z%0$B4 > HTTPS AUTH_TYPE PATH_INFO REMOTE_USER SCRIPT_NAME CONTENT_TYPE QUERY_STRING REMOTE_IDENTCONTENT_LENGTHREQUEST_METHODct|xsG|jdxs4|jdxs!|jdxrt|ddS)NHTTP_SSL_ REDIRECT_ ) _is_request startswith_needs_transcode)ks r1rErEsT q> CQ\\'2 Call66J C LL % A*:1QR5*ACr3ctj}d} djd|i}tj j D]\}}t|rtjdk(rtj jddj}|jdr!|jdjd}n|jd rny|jd r%d |vr!|jdjd}nC|j|djd}n!|j||jd}|||<|S#t$rd}YHwxYw) z'Read environment, fixing HTTP variablessurrogateescapezutf-8replacewin32SERVER_SOFTWAREzmicrosoft-iis/ iso-8859-1zapache/z simplehttp/zpython/3) sysgetfilesystemencodingencode LookupErrorosenvironitemsrEplatformgetlowerrDdecode)encescrSrFvsoftwares r1rr"sQ # # %C C '3G    "1 A ||w&::>>*;R@FFH&&'78)00>A((3 '' 6"h.)00>A i077 EA HHS#&--l; W#X Ng sE$$ E32E3ceZdZdZdZdZdZdZdZdZ dZ e Z e ZeZdZdZdgZd ZdxZZdZdZd Zd Zd Zd ZdZdZdZd$dZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.d Z/d!Z0d"Z1d#Z2y)%r z+Manage the invocation of a WSGI application)rrTFz1.0Nz500 Internal Server Error)z Content-Typez text/plains;A server error occurred. Please contact the administrator.rc |j||j|j|_|j y#t t tf$rYy |jYy#|jxYwxYw)zInvoke the applicationN) setup_environrSstart_responseresultfinish_responseConnectionAbortedErrorBrokenPipeErrorConnectionResetError handle_errorclose)self applications r1runzBaseHandler.runsv     %dllD4G4GHDK  "&9MN    !!#  s$AABBA//BBc|jjx}|_|j|j |d<|j |d<|j |d<|j|d<|j|d<|j|d<|j|d<|j|j|d <|jr*|jr|jd |jyyy) z&Set up the environment for one requestz wsgi.inputz wsgi.errorsz wsgi.versionz wsgi.run_oncezwsgi.url_schemezwsgi.multithreadzwsgi.multiprocessNzwsgi.file_wrapperrL) os_environcopyrS add_cgi_vars get_stdin get_stderr wsgi_version wsgi_run_once get_schemewsgi_multithreadwsgi_multiprocesswsgi_file_wrapper origin_serverserver_software setdefault)rhenvs r1r_zBaseHandler.setup_environs"__1133dl #'>>#3L#'??#4M#'#4#4N#'#5#5O#'??#4 #'#8#8 #'#9#9   ! ! -'+'='=C# $   $"6"6 NN,T-A-A B#7 r3c6 |jr|js2|jD]}|j||j |j y#t |jdr|jj xYw)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. rgN)result_is_filesendfilerawritefinish_contentrghasattrrhdatas r1rbzBaseHandler.finish_responsesv &&(  KKDJJt$(##% JJL t{{G, !!# s AA%%3Bc,t|jS)z Return the URL scheme being used)rrSrhs r1rszBaseHandler.get_schemesDLL))r3c t|j}|dk(r#t|j|jd<yy#t t tf$rYywxYw)z@Compute Content-Length or switch to chunked encoding if possiblerContent-LengthN)lenrastr bytes_sentheaders TypeErrorAttributeErrorNotImplementedError)rhblockss r1set_content_lengthzBaseHandler.set_content_lengthsZ %Fqy14T__1E -..)<=   sAAAcBd|jvr|jyy)zqMake any necessary header changes or defaults Subclasses can extend this to add other defaults. rN)rrrs r1cleanup_headerszBaseHandler.cleanup_headerss! 4<< /  # # % 0r3c|r |jr d}n|j td||_|j ||_|j |d}|j | |D]B\}}|j |d}|j |d}t|s6Jd|d|d|jS#d}wxYw) z4'start_response()' callable as specified by PEP 3333NzHeaders already set!Statusz Header namez Header valuezHop-by-hop header, 'z: z', not allowed) headers_sentrAssertionErrorstatus headers_class_convert_string_type_validate_statusrr~)rhrrexc_infonamevals r1r`zBaseHandler.start_responses  $$%  \\ % !78 8 ))'2 **68< f% $ c00}E//^D(.J-dV2cU.IJ.% zz! s CCctj|r tdt|dkr t d|ddj s t d|ddk7r t dy)Nz,Control characters are not allowed in statusz$Status must be at least 4 charactersz(Status message must begin w/3-digit code z+Status message must have a space after code)rsearch ValueErrorrrisdigit)rhrs r1rzBaseHandler._validate_statussn  % %f -KL L v;? !GH Hbqz!!# !KL L !9  !NO O r3cpt|tur|Stdj|t |)zConvert/check value type.z!{0} must be of type str (got {1}))typerrformatrepr)rhvaluetitles r1rz BaseHandler._convert_string_types4 ;# L / 6 6ud5k J  r3c:|jr|jr|jd|jd|jdj dd|j vr>|jdttjzj d|jr=d|j vr.|jd|jzj dy y y y |jd |jzj dy ) z6Transmit version/status/date/server, via self._write()zHTTP/rz rMDatez Date: %s Serverz Server: %s z Status: %s N) rwclient_is_modern_write http_versionrrPrr2r#rxrs r1 send_preamblezBaseHandler.send_preamble s   $$& 1B1B4;;OWWXdef-KK'*:499;*GGOOP\]''HDLL,HKK!1D4H4H!H P PQ] ^_-I' ' KK)DKK7?? M Nr3c:t|tusJd|js td|js!t ||_|jn|xj t |z c_|j||jy)z+'write()' callable as specified by PEP 3333z)write() argument must be a bytes instancezwrite() before start_response()N) rbytesrrrrr send_headersr_flushrs r1r~zBaseHandler.writes~DzU" 8 7 8"{{ !BC C""!$iDO     OOs4y (O D r3cy)aPlatform-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. Frs r1r}zBaseHandler.sendfile0s$r3cv|js-|jjdd|jyy)z.Ensure headers and content have both been sentr0N)rrryrrs r1rzBaseHandler.finish_contentEs1   LL # #$4c :     r3c t|jdr|jjdx|_x|_x|_|_d|_d|_y#dx|_x|_x|_|_d|_d|_wxYw)zClose the iterable (if needed) and reset all instance vars Subclasses may want to also drop the client connection. rgNrF)rrargrrrSrrrs r1rgzBaseHandler.closeOs  ;t{{7+ !!#FJ JDK J$, Jt|DOU!2GK JDK J$, Jt|DOU!2s 0A,B c|jd|_|jr|jr5|j |j t |jyy)z1Transmit headers to the client, via self._write()TN)rrrwrrrrrrs r1rzBaseHandler.send_headers\sP  !!T%:%:%<    KKdll+ ,&=r3cR|j}|duxrt|j|S)z@True if 'self.result' is an instance of 'self.wsgi_file_wrapper'N)rv isinstancera)rhwrappers r1r|zBaseHandler.result_is_filees(((d"Fz$++g'FFr3cB|jdjdk7S)z,True if client can accept status and headersSERVER_PROTOCOLzHTTP/0.9)rSupperrs r1rzBaseHandler.client_is_modernks ||-.446*DDr3c ddlm}|j}||d|d|d|j||j d}y#d}wxYw)zLog the 'exc_info' tuple in the server log Subclasses may override to retarget the output or change its format. r)print_exceptionrN) tracebackrrptraceback_limitflush)rhrrstderrs r1 log_exceptionzBaseHandler.log_exceptionpsR  1__&F  Xa[(1+$$f  LLNHtHs AA Ac|jtj|js<|j |j |j |_|jyy)z>Log current error, and send error output to client if possibleN) rrNrr error_outputrSr`rarbrs r1rfzBaseHandler.handle_errorsN 3<<>*  ++DLL$:M:MNDK  "!r3c||j|jddtj|jgS)aZWSGI 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_headersrNr error_body)rhrSr`s r1rzBaseHandler.error_outputs4 t((););A)>s||~N  r3ct)aOverride 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. rrs r1rzBaseHandler._writes "!r3ct)zOverride 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. rrs r1rzBaseHandler._flushs "!r3ct)z4Override in subclass to return suitable 'wsgi.input'rrs r1rozBaseHandler.get_stdin!!r3ct)z5Override in subclass to return suitable 'wsgi.errors'rrs r1rpzBaseHandler.get_stderrrr3ct)z>Override in subclass to insert CGI variables in 'self.environ'rrs r1rnzBaseHandler.add_cgi_varsrr3N)3__name__ __module__ __qualname____doc__rqrtrurrrwrrxrrlrrvrrrrrrrrarrrrjr_rbrsrrr`rrrr~r}rrgrr|rrrfrrrrorprnrr3r1r r ^s5LMMLO J$MO.L23MOJFVLGJ0C*4* &4P  O** ;-G E  #!&"""""r3r c8eZdZdZ d dZdZdZdZdZdZ y) r aqHandler 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)cX||_||_||_||_||_||_yr)stdinstdoutrbase_envrtru)rhrrrrS multithread multiprocesss r1__init__zSimpleHandler.__init__s0    +!-r3c|jSr)rrs r1rozSimpleHandler.get_stdins zzr3c|jSr)rrs r1rpzSimpleHandler.get_stderrs {{r3cN|jj|jyr)rSupdaterrs r1rnzSimpleHandler.add_cgi_varss DMM*r3c|jj|}||t|k(ryddlm}|dt ||dx}r$|jj|}||dx}r#yy)Nr)warnz9SimpleHandler.stdout.write() should not do partial writes)rr~rwarningsrDeprecationWarning)rhrrars r1rzSimpleHandler._writesr""4( >Vs4y0 ! H  67m#d#[[&&t,F67m#d#r3cn|jj|jj|_yr)rrrrs r1rzSimpleHandler._flushs# kk'' r3N)TF) rrrrrrorprnrrrr3r1r r s* (-.+-(r3r ceZdZdZdZy)r aCGI-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. FN)rrrrrwrr3r1r r s&Mr3r ceZdZdZdZiZdZy)r aCGI-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 tj|tjjtj jtj tddy)NFTrr)r rrNrbufferrrrrs r1rzCGIHandler.__init__s? #))""CJJ$5$5szz ND  r3Nrrrrrrrlrrr3r1r r s MJ r3r ceZdZdZdZiZdZy)r aCGI-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 dt}|jdd}|jdd}|dzj|dzr|t|d|d<tj |t jjt jjt j|ddy)Nr6rIr8/FTr) rrVrDrr rrNrrrr)rhrSpathscripts r1rzIISCGIHandler.__init__6s{{;+]B/ H  ,#'F #5GK  #))""CJJ$5$5szz T  r3Nrrr3r1r r s MJ  r3r )rutilrrrrrrrNrRr#__all__r%r&r2 __contains__rCrErr r r r r rr3r1rs5::1  A 8  , C9xX"X"v ,(K,(^]0