Skip to content

_ProtocolWrapper (access_log_hook path) missing __call__/__aiter__, likely breaks body-reading routes under Granian #216

Description

@ZhuchkaTriplesix

Where: oxyroute/app.py:24-53 (_ProtocolWrapper), used in __rsgi__ when access_log_hook is set (app.py:796-813).

The wrapper proxies response_empty/response_str/response_bytes/response_file/response_stream, but Granian's RSGI protocol object is also callable (await protocol()) to read the request body and asynchronously iterable for streaming bodies — neither __call__ nor __aiter__/__anext__ is forwarded. Any route that reads a JSON/form body while access_log_hook is configured should fail under real Granian (not caught by the test suite, which drives handle_rsgi directly and bypasses __rsgi__/the wrapper for the body-read step).

Fix direction: forward __call__ and the async-iterator protocol to self._inner on _ProtocolWrapper; add an integration test that exercises access_log_hook + a body-reading route through __rsgi__.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions