3 ^c @stddlZddddddgZGdddZd dZd dZdd dZd dZddZdddddddddjZ ddZ dS)N FileWrapper guess_schemeapplication_uri request_urishift_path_infosetup_testing_defaultsc@s.eZdZd ddZddZddZdd Zd S) r cCs"||_||_t|dr|j|_dS)Nclose)filelikeblksizeZhasattrr)selfr r r $/usr/lib64/python3.6/wsgiref/util.py__init__s zFileWrapper.__init__cCs|jj|j}|r|StdSN)r readr Z IndexError)r Zkeydatar r r __getitem__zFileWrapper.__getitem__cCs|Srr )r r r r __iter__szFileWrapper.__iter__cCs|jj|j}|r|StdSr)r rr Z StopIteration)r rr r r __next__rzFileWrapper.__next__N)r)Z__name__Z __module__Z __qualname__rrrrr r r r r s cCs|jddkrdSdSdS)NZHTTPSyeson1httpshttp)rrr)get)environr r r r#scCs|dd}ddlm}|jdr0||d7}nR||d7}|ddkrf|dd kr|d |d7}n|dd kr|d |d7}|||jd pd dd7}|S)Nwsgi.url_schemez://rquote HTTP_HOST SERVER_NAMEr SERVER_PORT443z:80 SCRIPT_NAME/latin1)encoding) urllib.parserr)rurlrr r r r+s       TcCspt|}ddlm}||jddddd}|jdsF||d d7}n||7}|rl|jd rl|d |d 7}|S) Nrr PATH_INFOz/;=,r')Zsafer(r%Z QUERY_STRINGz?)rr)rr)rZ include_queryr*r path_infor r r r?s  cCs|jdd}|sdS|jd}dd|dd D|dd <|d}|d=|jdd}tj|d|}|jdr~|dd }| r|jd r|d7}||d<dj||d<|dkrd}|S) Nr+r,r&cSsg|]}|r|dkr|qS).r )Z.0Zpr r r z ^sz#shift_path_info..r-r%r/r0r0)rZsplit posixpathZnormpathZendswithZjoin)rr.Z path_partsZnameZ script_namer r r rLs$     cCs|jdd|jdd|jd|d|jddd|kr\d |kr\|jdd |jd d |jd d|jdd|jdd|jddddlm}m}|jd||jd||jdt||ddkr|jddn|ddkr|jdddS)Nr!z 127.0.0.1ZSERVER_PROTOCOLzHTTP/1.0r ZREQUEST_METHODZGETr%r+r,r&z wsgi.versionr-rz wsgi.run_oncezwsgi.multithreadzwsgi.multiprocess)StringIOBytesIOz wsgi.inputz wsgi.errorsrrr"r$rr#)r-r)Z setdefaultZior2r3r)rr2r3r r r rus&           r-)Z connectionz keep-alivezproxy-authenticatezproxy-authorizationZteZtrailersztransfer-encodingZupgradecCs t|jSr)_hoppishZlower)Z header_namer r r is_hop_by_hopsr5)T) r1Z__all__rrrrrrZ __contains__r4r5r r r r Zs ))