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

request.stdin stream manipulation breaks when used under gunicorn #15

Open
LadyNamedLaura opened this issue Jan 27, 2022 · 0 comments
Open

Comments

@LadyNamedLaura
Copy link

_get_request_from_request(request):¹ tries to do:

    body_pos = request.stdin.tell()
    request.stdin.seek(0)
    body = request.stdin.read()
    request.stdin.seek(body_pos)

However, it seems like under gunicorn this request.stdin doesn't have the tell method. (nor the seek method)²
Given that neither body_pos nor body seem to be used in that method, I'd suggest removing those 4 lines to make this code compatible with gunicorn. (or somehow check if tell is available)

¹ https://github.com/collective/collective.sentry/blob/master/collective/sentry/error_handler.py#L90-L93
¹ https://github.com/benoitc/gunicorn/blob/master/gunicorn/http/body.py#L177

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

No branches or pull requests

1 participant