Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/urllib3/util/__pycache__/response.cpython-311.pyc
]j
L d dl mZ d dlmZmZ ddlmZ ddlmZ d Z
d Zd Zd S )
)absolute_import)!MultipartInvariantViolationDefectStartBoundaryNotFoundDefect )HeaderParsingError)http_clientc | S # t $ r Y nw xY w | j S # t $ r Y nw xY w | j du S # t $ r Y nw xY wt d )zt
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
Nz)Unable to determine whether fp is closed.)isclosedAttributeErrorclosedfp
ValueError)objs L/opt/imunify360/venv/lib64/python3.11/site-packages/urllib3/util/response.pyis_fp_closedr s
||~~
z
v~
@
A
AAs)
##.
;;A
AAc t | t j s/t d t | t
| dd }t
| dd }d}|r<| s( | }t |t t f r|}|rd |D }|s|rt || dS )a>
Asserts whether all headers have been successfully parsed.
Extracts encountered errors from the result of parsing headers.
Only works on Python 3.
:param http.client.HTTPMessage headers: Headers to verify.
:raises urllib3.exceptions.HeaderParsingError:
If parsing errors are found.
z"expected httplib.Message, got {0}.defectsNget_payloadc J g | ] }t |t t f |!S )
isinstancer r ).0defects r
<listcomp>z)assert_header_parsing.<locals>.<listcomp>R sD
46WX
)r
unparsed_data)r httplibHTTPMessage TypeErrorformattypegetattris_multipartbytesstrr )headersr r r payloads r assert_header_parsingr( ( s gw233 T<CCDMMRRSSSgy$//G'=$77KM ( ##%% (!kmmG'E3<00
( '
!
O- O
NNNNO Or c v | j }t |t r|dk S | dk S )z
Checks whether the request of a response has been a HEAD-request.
Handles the quirks of AppEngine.
:param http.client.HTTPResponse response:
Response to check if the originating request
used 'HEAD' as a method.
HEAD)_methodr intupper)responsemethods r is_response_to_headr1 ^ s;
F&# {<<>>V##r N)
__future__r email.errorsr r
exceptionsr packages.six.movesr r r r( r1 r r r <module>r6 s &