http_response_parser.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:midip-sslyze 作者: soukupa5 项目源码 文件源码
def parse_http_response(sock):

    try:
        # H4ck to standardize the API between sockets and SSLConnection objects
        response = sock.read(4096)
    except AttributeError:
        response = sock.recv(4096)

    if 'HTTP/' not in response:
        # Try to get the rest of the response
        try:
            response += sock.read(4096)
        except AttributeError:
            response += sock.recv(4096)

    fake_sock = FakeSocket(response)
    response = HTTPResponse(fake_sock)
    response.begin()

    return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号