python (3.12.0)

(root)/
lib/
python3.12/
wsgiref/
__pycache__/
util.cpython-312.pyc

̑e`ndZddlZgdZGddZdZdZd
dZd	Zd
ZhdjZ
dZy)z$Miscellaneous WSGI-related UtilitiesN)FileWrapperguess_schemeapplication_urirequest_urishift_path_infosetup_testing_defaultsc$eZdZdZddZdZdZy)rz1Wrapper to convert file-like objects to iterablesc\||_||_t|dr|j|_yy)Nclose)filelikeblksizehasattrr)selfrr
s   @/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/wsgiref/util.py__init__zFileWrapper.__init__s* 
8G$!DJ%c|SN)rs r__iter__zFileWrapper.__iter__src`|jj|j}|r|Str)rreadr

StopIteration)rdatas  r__next__zFileWrapper.__next__s(}}!!$,,/KrN)i )__name__
__module____qualname____doc__rrrrrrrrs;(rrc,|jddvryy)zMReturn a guess for whether 'wsgi.url_scheme' should be 'http' or 'https'
    HTTPS)yeson1httpshttp)get)environs rrrs{{7//rc|ddz}ddlm}|jdr	||dz
}n7||dz
}|ddk(r|dd	k7r|d
|dzz
}n|ddk7r|d
|dzz
}|||jdxsd
dz
}|S)z@Return the application's base URI (no PATH_INFO or QUERY_STRING)wsgi.url_schemez://rquote	HTTP_HOSTSERVER_NAMEr%SERVER_PORT443:80SCRIPT_NAME/latin1)encoding)urllib.parser,r')r(urlr,s   rrr%s
#
$U
*C"{{;w{##w}%%$%0}%.sW]333}%-sW]3335]+2sXFFCJrct|}ddlm}||jdddd}|jds	||d	d
z
}n||z
}|r|jdr|d|dzz
}|S)
zBReturn the full request URI, optionally including the query stringrr+	PATH_INFOz/;=,r5)safer6r3NQUERY_STRING?)rr7r,r')r(
include_queryr8r,	path_infos     rrr9su
'
"C"gkk+b1RI;;}%y}y^4sW^,,,Jrc|jdd}|sy|jd}|ddDcgc]
}|s|dk7s|c}|dd|d}|d=|jdd}tj|dz|z}|j	dr|dd}|s|j	ds|dz
}||d<dj||d<|dk(rd}|Scc}w)	aZShift a name from PATH_INFO to SCRIPT_NAME, returning it

    If there are no remaining path segments in PATH_INFO, return None.
    Note: 'environ' is modified in-place; use a copy if you need to keep
    the original PATH_INFO or SCRIPT_NAME.

    Note: when PATH_INFO is just a '/', this returns '' and appends a trailing
    '/' to SCRIPT_NAME, even though empty path segments are normally ignored,
    and SCRIPT_NAME doesn't normally end in a '/'.  This is intentional
    behavior, to ensure that an application can tell the difference between
    '/x' and '/x/' when traversing to objects.
    r:r;Nr4r=.r3)r'split	posixpathnormpathendswithjoin)r(rA
path_partspnamescript_names      rrrFsK+I%J#-a#3FaqQ#XFJqa=D1
++mB/K$$[_T%9:KC !#2&,,S1s(GM XXj1GKSyK+GsCCCc|jdd|jdd|jd|d|jddd|vr(d	|vr$|jdd
|jd	d|jdd
|jdd|jdd|jddddlm}m}|jd||jd||jdt	||ddk(r|jddy|ddk(r|jddyy)a:Update 'environ' with trivial defaults for testing purposes

    This adds various parameters required for WSGI, including HTTP_HOST,
    SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
    and all of the wsgi.* variables.  It only supplies default values,
    and does not replace any existing settings for these variables.

    This routine is intended to make it easier for unit tests of WSGI
    servers and applications to set up dummy environments.  It should *not*
    be used by actual WSGI servers or applications, since the data is fake!
    r.z	127.0.0.1SERVER_PROTOCOLzHTTP/1.0r-REQUEST_METHODGETr3r:r;r4zwsgi.version)r=rz
wsgi.run_oncerzwsgi.multithreadzwsgi.multiprocess)StringIOBytesIOz
wsgi.inputzwsgi.errorsr*r&r/r2r%r0N)
setdefaultiorRrSr)r(rRrSs   rrros:}[1(4{7=#9:'.G#7(B=,;s+~u-*)1-*A.$|WY/}hj1(g)>? !6)=$/	"	#W	,=%0
-r>
keep-alivetransfer-encodingproxy-authenticateproxy-authorizationteupgradetrailers
connectionc4t|jS)z?Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header)_hoppishlower)header_names r
is_hop_by_hoprbsK%%'((r)T)rrF__all__rrrrrr__contains__r_rbrrr<module>resM*$('R$1P,		)r