Skip to content

[Ask] Trying to parse a response and the proxy just stops #1102

Answered by alexandresgf
alexandresgf asked this question in Q&A
Discussion options

You must be logged in to vote

Nevermind, I just was using it in a wrong way. As you said, I checked the state and now everything works!

The final code:

def handle_upstream_data(self, raw: memoryview) -> None:
    logger.debug("Creating the Response Parser...")
    response = HttpParser(httpParserTypes.RESPONSE_PARSER)
    logger.debug("Parsing the upstream data...")
    response.parse(raw)

    if response.is_complete:
        logger.debug(
            "Response completed with status code %s",
            response.code,
        )

    super().handle_upstream_data(raw)

Thanks!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by abhinavsingh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1101 on March 08, 2022 07:05.