⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3.12
/
wsgiref
/
__pycache__
/
View File Name :
headers.cpython-312.pyc
CRhn P d Z ddlZ ej d ZddZ G d d Zy)zManage HTTP Response Headers Much of this module is red-handedly pilfered from email.message in the stdlib, so portions are Copyright (C) 2001,2002 Python Software Foundation, and were written by Barry Warsaw. Nz[ \(\)<>@,;:\\"/\[\]\?=]c |Vt | dkD rH|st j | r*|j dd j dd }| d|dS | d|S | S )z~Convenience function to format and return a key=value pair. This will quote the value if needed or if quote is true. r \z\\"z\"z="=)len tspecialssearchreplace)paramvaluequotes &/usr/lib/python3.12/wsgiref/headers.py_formatparamr s\ SZ!^I$$U+MM$/77UCE %u--#U++ c z e Zd ZdZddZd Zd Zd Zd Zd Z d Z d ZddZd Z d Zd Zd Zd Zd Zd Zd Zy)Headersz,Manage a collection of HTTP response headersNc ||ng }t | t urt d || _ |D ]' \ }}| j | | j | ) y )Nz+Headers must be a list of name/value tuples)typelist TypeError_headers_convert_string_type)selfheaderskvs r __init__zHeaders.__init__ sZ $0'b=$IJJ 1))!,))!, r c n t | t u r|S t dj t | )zConvert/check value type.z1Header names/values must be of type str (got {0}))r strAssertionErrorformatrepr)r r s r r zHeaders._convert_string_type) s3 ;#L %%+VDK%8: :r c , t | j S )z9Return the total number of headers, including duplicates.)r r r s r __len__zHeaders.__len__0 s 4==!!r c | |= | j j | j | | j | f y)zSet the value of a header.N)r appendr )r namevals r __setitem__zHeaders.__setitem__4 s: J & &t ,d.G.G.LM Or c | j |j }| j D cg c] }|d j |k7 s| c}| j dd yc c}w )zyDelete all occurrences of a header, if present. Does *not* raise an exception if the header is missing. r Nr lowerr r r( kvs r __delitem__zHeaders.__delitem__: sO ((6)-P2"Q%++-4:OBP aPs A Ac $ | j | S )aH Get the first header value for 'name' Return None if the header is missing instead of raising an exception. Note that if the header appeared multiple times, the first exactly which occurrence gets returned is undefined. Use getall() to get all the values matching a header field name. getr r( s r __getitem__zHeaders.__getitem__B s xx~r c ( | j | duS )z/Return true if the message contains the header.Nr2 r4 s r __contains__zHeaders.__contains__M s xx~T))r c | j |j }| j D cg c] }|d j |k( s|d c}S c c}w )aq Return a list of all the values for the named field. These will be sorted in the order they appeared in the original header list or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. If no fields exist with the given name, returns an empty list. r r, r. s r get_allzHeaders.get_allR sK ((6 $ E "A1D1 EEEs A Ac | j |j }| j D ] \ }}|j |k( s|c S |S )z:Get the first header value for 'name', or return 'default'r, )r r( defaultr r s r r3 zHeaders.get^ sC ((6==CAawwy$ ! r c L | j D cg c] \ }}| c}}S c c}}w )a* Return a list of all the header field names. These will be sorted in the order they appeared in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. r r r r s r keyszHeaders.keysg $ #mm,mdam,,, c L | j D cg c] \ }}| c}}S c c}}w )a! Return a list of all header values. These will be sorted in the order they appeared in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. r> r? s r valueszHeaders.valuesq rA rB c | j dd S )a Get all the header fields and values. These will be sorted in the order they were in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. Nr> r$ s r itemsz Headers.items{ s }}Qr c N | j j d| j dS )N()) __class____name__r r$ s r __repr__zHeaders.__repr__ s >>22DMMBBr c n dj | j D cg c] }d|z c}ddgz S c c}w )zkstr() returns the formatted headers, complete with end line, suitable for direct HTTP transmission.z z%s: %s )joinr )r r/ s r __str__zHeaders.__str__ s6 {{DMMBMbHrMMBBr7JKKBs 2c 6 t | j d S )Nz iso-8859-1)r encoder$ s r __bytes__zHeaders.__bytes__ s 4y--r c | j | }|=| j j | j | | j | f |S |S )zReturn first matching header value for 'name', or 'value' If there is no header named 'name', add a new header with name 'name' and value 'value'.)r3 r r' r )r r( r results r setdefaultzHeaders.setdefault sR $>MM $";";D"A))%0"2 3LMr c g }|"| j | }|j | |j D ]v \ }}| j | }|"|j |j dd ;| j | }|j t |j dd | x | j j | j | dj | f y)af Extended header setting. _name is the header field to add. keyword arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as key="value" unless value is None, in which case only the key will be added. Example: h.add_header('content-disposition', 'attachment', filename='bud.gif') Note that unlike the corresponding 'email.message' method, this does *not* handle '(charset, language, value)' tuples: all values must be strings or None. N_-z; )r r' rF r r r rO )r _name_value_paramspartsr r s r add_headerzHeaders.add_header s ..v6FLL MMODAq))!,AyQYYsC01--a0\!))C*=qAB $ d77> %@PQRr )N)rK __module____qualname____doc__r r r% r* r0 r5 r7 r: r3 r@ rD rF rL rP rS rV r^ r r r r s` 6-:"OQ * F-- CL .Sr r )Nr9 )ra recompiler r r rb r r
re s3 BJJ23 \S \Sr