mirror of
https://github.com/kennethreitz/responder.git
synced 2026-07-21 18:39:29 +00:00
efb05827b7
- Mounted sub-app dispatch inferred WSGI-vs-ASGI from the *text* of a
TypeError raised while calling the app ("argument"/"positional"), so a
genuine TypeError inside a mounted ASGI app was misclassified as WSGI and
its real traceback destroyed. Decide from the call signature up front
(_is_wsgi_app): coroutine / async __call__ / __asgi_app__ => ASGI, a
two-positional (environ, start_response) signature => WSGI.
- The lifespan handler was called with scope.get("app"), but Responder never
set scope["app"], so a standard `async def lifespan(app)` always received
None. Set scope["app"] = self.api before invoking it.
- auto_etag hashed the response body with MD5 on the event loop; for a large
auto-etagged body that blocks the loop. Offload the hash to a thread above
64 KiB; small bodies stay inline.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>