• File: validate.cpython-37.opt-2.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python37/lib64/python3.7/wsgiref/__pycache__/validate.cpython-37.opt-2.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 10.78 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

YI~d:@sdgZddlZddlZddlZedZedZGdddeZddZ	d	d
Z
ddZGdd
d
ZGdddZ
GdddZGdddZGdddZddZddZddZddZddZd d!Zd"d#Zd$d%ZdS)&	validatorNz^[a-zA-Z][a-zA-Z0-9\-_]*$z[\000-\037]c@seZdZdS)WSGIWarningN)__name__
__module____qualname__rr5/opt/alt/python37/lib64/python3.7/wsgiref/validate.pyrysrcGs|st|dS)N)AssertionError)Zcondargsrrrassert_~srcCs(t|tkr|Std|t|dS)Nz!{0} must be of type str (got {1}))typestrr	formatrepr)valuetitlerrrcheck_string_typesrcsfdd}|S)Ncstt|dkdt|d|\}t|gfdd}t|d|d<t|d|d<||}t|dk	oz|dkd	t|t|S)
NzTwo arguments requiredzNo keyword arguments allowedcstt|dkpt|dkd|ft|d|d}|d}t|dkrV|d}nd}t|t|t||t|dt|S)NrzInvalid number of arguments: %szNo keyword arguments allowedr)rlencheck_status
check_headerscheck_content_typecheck_exc_infoappendWriteWrapper)r
kwstatusheadersexc_info)start_responsestart_response_startedrrstart_response_wrappers


z;validator.<locals>.lint_app.<locals>.start_response_wrapperz
wsgi.inputzwsgi.errorsFz>The application must return an iterator, if only an empty list)rr
check_environInputWrapperErrorWrappercheck_iteratorIteratorWrapper)r
renvironr#iterator)application)r!r"rlint_apps
zvalidator.<locals>.lint_appr)r+r,r)r+rrs)c@s<eZdZddZddZddZddZd	d
ZddZd
S)r%cCs
||_dS)N)input)self
wsgi_inputrrr__init__szInputWrapper.__init__cGs0tt|dk|jj|}tt|tk|S)Nr)rrr-readrbytes)r.r
vrrrr1szInputWrapper.readcGs0tt|dk|jj|}tt|tk|S)Nr)rrr-readlinerr2)r.r
r3rrrr4szInputWrapper.readlinecGsNtt|dk|jj|}tt|tkx|D]}tt|tkq2W|S)Nr)rrr-	readlinesrlistr2)r.r
lineslinerrrr5s
zInputWrapper.readlinesccs x|}|sdS|VqWdS)N)r4)r.r8rrr__iter__s
zInputWrapper.__iter__cCstdddS)Nrz input.close() must not be called)r)r.rrrcloseszInputWrapper.closeN)	rrrr0r1r4r5r9r:rrrrr%sr%c@s4eZdZddZddZddZddZd	d
ZdS)r&cCs
||_dS)N)errors)r.wsgi_errorsrrrr0szErrorWrapper.__init__cCs tt|tk|j|dS)N)rrr
r;write)r.srrrr=szErrorWrapper.writecCs|jdS)N)r;flush)r.rrrr?szErrorWrapper.flushcCsx|D]}||qWdS)N)r=)r.seqr8rrr
writeliness
zErrorWrapper.writelinescCstdddS)Nrz!errors.close() must not be called)r)r.rrrr:szErrorWrapper.closeN)rrrr0r=r?rAr:rrrrr&s
r&c@seZdZddZddZdS)rcCs
||_dS)N)writer)r.Zwsgi_writerrrrr0szWriteWrapper.__init__cCstt|tk||dS)N)rrr2rB)r.r>rrr__call__szWriteWrapper.__call__N)rrrr0rCrrrrrsrc@seZdZddZddZdS)PartialIteratorWrappercCs
||_dS)N)r*)r.
wsgi_iteratorrrrr0szPartialIteratorWrapper.__init__cCst|jdS)N)r(r*)r.rrrr9szPartialIteratorWrapper.__iter__N)rrrr0r9rrrrrDsrDc@s4eZdZddZddZddZddZd	d
ZdS)r(cCs ||_t||_d|_||_dS)NF)original_iteratoriterr*closedcheck_start_response)r.rErIrrrr0	s
zIteratorWrapper.__init__cCs|S)Nr)r.rrrr9szIteratorWrapper.__iter__cCsTt|jdt|j}t|tk	r4tdd|f|jdk	rPt|jdd|_|S)NzIterator read after closedFz$Iterator yielded non-bytestring (%r)zjThe application returns and we started iterating over its body, but start_response has not yet been called)rrHnextr*rr2rI)r.r3rrr__next__s

zIteratorWrapper.__next__cCs d|_t|jdr|jdS)NTr:)rHhasattrrFr:)r.rrrr:szIteratorWrapper.closecCs"|jstjdt|jddS)Nz/Iterator garbage collected without being closed)rHsysstderrr=r)r.rrr__del__#s
zIteratorWrapper.__del__N)rrrr0r9rKr:rOrrrrr(s
r(cCstt|tkdt||fx dD]}t||kd|fq$Wx*dD]"}t||kd||ddfqFWd|krtdtxF|D]:}d	|krqtt||tkd
|t||||fqWtt|dtkd|dft|d
dkd|d
t	|dt
|d|ddkr<td|dtt|dpX|ddd|dt|dp|ddd|d|drtt
|ddkd|d|dstd|kdt|ddkddS)Nz:Environment is not of the right type: %r (environment: %r))	REQUEST_METHODZSERVER_NAMEZSERVER_PORTzwsgi.versionz
wsgi.inputzwsgi.errorszwsgi.multithreadzwsgi.multiprocessz
wsgi.run_oncez$Environment missing required key: %r)ZHTTP_CONTENT_TYPEZHTTP_CONTENT_LENGTHz8Environment should not have the key: %s (use %s instead)ZQUERY_STRINGzQUERY_STRING is not in the WSGI environment; the cgi module will use sys.argv when this variable is missing, so application errors are more likely.z9Environmental variable %s is not a string: %r (value: %r)zwsgi.versionz#wsgi.version should be a tuple (%r)zwsgi.url_scheme)ZhttpZhttpszwsgi.url_scheme unknown: %rz
wsgi.inputzwsgi.errorsrP)ZGETZHEADZPOSTZOPTIONSZPATCHZPUTZDELETEZTRACEzUnknown REQUEST_METHOD: %rZSCRIPT_NAME/z$SCRIPT_NAME doesn't start with /: %rZ	PATH_INFOz"PATH_INFO doesn't start with /: %rZCONTENT_LENGTHrzInvalid CONTENT_LENGTH: %rzgOne of SCRIPT_NAME or PATH_INFO are required (PATH_INFO should at least be '/' if SCRIPT_NAME is empty)zOSCRIPT_NAME cannot be '/'; it should instead be '', and PATH_INFO should be '/')rrdictwarningswarnrkeysr
tuplecheck_inputcheck_errorsget
startswithint)r)keyrrrr$*sZ


r$cCs*x$dD]}tt||d||fqWdS)N)r1r4r5r9z-wsgi.input (%r) doesn't have the attribute %s)rrL)r/attrrrrrYks

rYcCs*x$dD]}tt||d||fqWdS)N)r?r=rAz.wsgi.errors (%r) doesn't have the attribute %s)rrL)r<r_rrrrZqs

rZcCsvt|d}|ddd}tt|dkd|t|}t|dkd|t|dksb|dd	krrtd
|tdS)NStatusrrrz)Status codes must be three characters: %rdzStatus code is invalid: %r zjThe status string (%r) should be a three-digit integer followed by a single space and a status explanation)rsplitrrr]rUrVr)rZstatus_codeZ
status_intrrrrws

rcCstt|tkd|t|fx|D]}tt|tkd|t|ftt|dk|\}}t|d}t|d}t|dkd|td|kod	|kd
|tt|d|t|	do|	d
d|t
|r$tdd|t
|dfq$WdS)Nz%Headers (%r) must be of type list: %rz1Individual headers (%r) must be of type tuple: %rrzHeader namezHeader valuerzyThe Status header cannot be used; it conflicts with CGI script, and HTTP status is not given through headers (value: %r).
:z,Header names may not contain ':' or '\n': %rzBad header name: %r-_z#Names may not end in '-' or '_': %rrz#Bad header value: %r (bad char: %r))rrr6rXrrlower	header_researchendswithbad_header_value_regroup)ritemnamerrrrrs,





rcCs~t|d}t|ddd}d}x@|D]8\}}t|d}|dkr(||krRdStdd|q(W||krztdd|dS)	Nr`rr)i0zHeader namezcontent-typezJContent-Type header found in a %s response, which must not return content.z,No Content-Type header found in headers (%s))rr]rdrir)rrcodeZNO_MESSAGE_BODYrprrrrrs

rcCs*t|dkpt|tkd|t|fdS)Nz exc_info (%r) is not a tuple: %r)rrrX)r rrrrsrcCstt|ttfddS)NzwYou should not return a string as your application iterator, instead return a single-item list containing a bytestring.)r
isinstancer
r2)r*rrrr'sr')__all__rerMrUcompilerjrmWarningrrrrr%r&rrDr(r$rYrZrrrrr'rrrr<module>os,

7#		#A