Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance handing of ASGI request body #1646

Closed
antonpirker opened this issue Sep 28, 2022 · 1 comment · Fixed by #1649
Closed

Enhance handing of ASGI request body #1646

antonpirker opened this issue Sep 28, 2022 · 1 comment · Fixed by #1649

Comments

@antonpirker
Copy link
Member

antonpirker commented Sep 28, 2022

Problem Statement

In ASGI the request body is a stream and once it has been consumed it can not be consumed again.

This leads to some problems because in case of an error we try to extract information from the request body to give more context (this is also happening for transaction data, I guess)

Related issues:
#1631
#1595
#1632 (comment)

Solution Brainstorm

Refactor the RequestExtractor of all frameworks that can run in ASGI servers. Also improve the DjangoRequestExtractor so it can handle both WSGI and ASGI requests.

Also make the AnnotatedValue more easily understandable, because now this is a lot of magic numbers that no one really know what they are doing.

The length and range is not used in those values, so the minimum looks like this: { "rem": [["!config", "x"]] }
And !raw means that the body was not parsable (so .json() and .parsed_body() did return None) and !config means the body was over a certain threshold and therefore too big for sending.

@antonpirker
Copy link
Member Author

Some context about the AnnotatedValues:

Screenshot 2022-09-28 at 16 45 30
Screenshot 2022-09-28 at 16 49 29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants