python (3.11.7)

(root)/
lib/
python3.11/
wsgiref/
__pycache__/
simple_server.cpython-311.opt-1.pyc

e3<dZddlmZmZddlZddlZddlmZddl	m
Z
dZgdZdezZ
e
d	zejdzZe
d
zezZGddeZGd
deZGddeZdZeefdZedkredde5ZejZededdeddddlZejdeddddS#1swxYwYdSdS)a!BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)

This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application.  It has not been reviewed for security issues,
however, and we strongly recommend that you use a "real" web server for
production use.

For example usage, see the 'if __name__=="__main__"' block at the end of the
module.  See also the BaseHTTPServer module docs for other API information.
)BaseHTTPRequestHandler
HTTPServerN)
SimpleHandler)python_implementationz0.2)
WSGIServerWSGIRequestHandlerdemo_appmake_serverWSGIServer// ceZdZeZdZdS)
ServerHandlerc	|j|jddd|jtj|dS#tj|wxYw)Nr
r)request_handlerlog_requeststatussplit
bytes_sentrcloseselfs I/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/wsgiref/simple_server.pyrzServerHandler.close sp	& ,,!!#a((+T_



%%%%%M%%%%s?AA-N)__name__
__module____qualname__software_versionserver_softwarerrrrs(&O&&&&&r!rc.eZdZdZdZdZdZdZdZdS)rz7BaseHTTPServer that implements the Python WSGI protocolNcVtj||dS)z.Override server_bind to store the server name.N)rserver_bind
setup_environrs rr$zWSGIServer.server_bind0s+t$$$r!cix}|_|j|d<d|d<t|j|d<d|d<d|d<d|d<dS)	NSERVER_NAMEzCGI/1.1GATEWAY_INTERFACESERVER_PORTREMOTE_HOSTCONTENT_LENGTHSCRIPT_NAME)base_environserver_namestrserver_port)renvs  rr%zWSGIServer.setup_environ5sa"$$d!-M#,  !122MM Mr!c|jSNapplicationrs rget_appzWSGIServer.get_app?sr!c||_dSr4r5)rr6s  rset_appzWSGIServer.set_appBs&r!)	rrr__doc__r6r$r%r7r9r r!rrr*s[AAK
      '''''r!rc*eZdZdezZdZdZdZdS)rrc|jj}|j|d<|j|d<|j|d<d|jvr|jdd\}}n	|jd}}tj	
|d|d<||d	<|}||jd
kr||d<|jd
|d<|j
d
|j
|d<n|j
d
|d<|j
d}|r||d<|j
D]l\}}|dd}|}||vrFd|z|vr|d|zxxd|zz
cc<d||d|z<m|S)NSERVER_PROTOCOLSERVER_SOFTWAREREQUEST_METHOD?rr*z
iso-8859-1	PATH_INFOQUERY_STRINGrr+REMOTE_ADDRzcontent-typeCONTENT_TYPEzcontent-lengthr,-_HTTP_,)serverr.copyrequest_versionserver_versioncommandpathrurllibparseunquoteaddress_stringclient_addressheadersgetget_content_typeitemsreplaceupperstrip)rr2rNqueryhostlengthkvs        rget_environzWSGIRequestHandler.get_environKsk&++--!%!5!%!4 $$)Q//JD2D!<//lCCK#N""$$4&q)))!%C
!03M<N++3"&,"?"?"A"AC"&,~">C!!"233	+$*C !L&&((	#	#DAqiiC  &&((AAGGII!CxxqyCGAI#a%'!"GAI
r!ctjSr4)sysstderrrs r
get_stderrzWSGIRequestHandler.get_stderrps
zr!c|jd|_t|jdkr,d|_d|_d|_|ddS|sdSt|j|j
||d}||_
||jdS)zHandle a single HTTP requestiir*iNF)multithread)rfilereadlineraw_requestlinelenrequestlinerKrM
send_error
parse_requestrwfilerdr`rrunrIr7)rhandlers  rhandlezWSGIRequestHandler.handless $z22599t#$$u,,!D#%D DLOOC   F!!##	FJ
DOO$5$5t7G7G7I7I


#'DK''))*****r!N)rrr__version__rLr`rdrqr r!rrrGsL"[0N###J+++++r!rc`ddlm}|}td|t|t|}|D]%\}}t|dt||&|ddg|dgS)	Nr)StringIOzHello world!)file=z200 OK)zContent-Typeztext/plain; charset=utf-8zutf-8)iortprintsortedrWreprgetvalueencode)environstart_responsertstdouthr^r_s       rr	r	s
XZZF	.v&&&&	vw}}A**!
aDGG&)))))N8JKLLLOO$$W--..r!cL|||f|}|||S)zACreate a new WSGI server listening on `host` and `port` for `app`)r9)r\portappserver_class
handler_classrIs      rr
r
s0\4,

6
6F
NN3Mr!__main__r*i@zServing HTTP onrrz...zhttp://localhost:8000/xyz?abc) r:http.serverrrrburllib.parserOwsgiref.handlersrplatformrrr__all__rLversionrsys_versionrrrrr	r
rhttpdsocketgetsocknamesarx
webbrowseropenhandle_requestr r!r<module>rsS

;:::::::



************
I
I
I,##%%+ck.?.?.A.A!.DD!C'+5
&
&
&
&
&M
&
&
&'''''''':?+?+?+?+?+/?+?+?+F	/	/	/#-<Nz	Rx	(	(E
\
%
%
'
'
A1u===
7888
s%ADDD