• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zappa / Zappa / 22704795007

05 Mar 2026 06:06AM UTC coverage: 74.025% (+1.3%) from 72.761%
22704795007

push

github

web-flow
Add ASGI support and refactor codebase (#1422)

* :sparkles: add ASGI support :recycle: refactor codebase for clarity

Add ASGI handler supporting FastAPI, Starlette, and Quart frameworks on
AWS Lambda with API Gateway v1/v2, ALB, and Function URL events. Includes
ASGIHandler bridge, scope/body creation, autodetection, and full test suite.

Refactor across two rounds:
- :bug: fix response_time units (ms -> μs) in ASGI/WSGI v2 handlers
- :fire: remove Python 2 remnants (builtins imports, getargspec fallback)
- :recycle: extract shared helpers (extract_request_body, _detect_apps_by_pattern,
  _handle_request_exception, _get_boto_session, import_and_get_function)
- :recycle: deduplicate AWS region lists, consolidate BINARY_METHODS in utilities
- :recycle: move HTTPStatus import to module level, remove dead code paths
- :bug: fix mutable default arg in create_wsgi_request
- :bug: fix resource leaks in letsencrypt.py (unclosed file handles)
- :art: replace debug print() with logger.debug() in cognito trigger
- :fire: remove redundant logger, unnecessary .keys() calls, dead NameError handler

* :memo: add ASGI documentation to README

Add ASGI Support section with FastAPI, Starlette, and Quart setup
guides. Document app_type setting, binary support behavior, handler
internals, and current limitations.

* :wrench: address PR review feedback from Copilot

- Safe port parsing with try/except in asgi.py
- Return http.disconnect immediately in ASGIHandler.receive()
- Validate ASGI callable when app_type="asgi" is set
- Fix resolve_context_headers KeyError with safe .get()
- Fix v2 response_body default from None to ""
- Always set body in v1 ASGI response (even when empty)
- Fix memory allocation in _log_asgi_request
- Correct README: "asyncio event loop" not "asyncio.run()"

* :recycle: normalize header keys in create_asgi_scope

Use lowercase header dict for consistent lookups, defer byte encoding
to just before scope construction.

---------

Co-authored-by: ... (continued)

3551 of 4797 relevant lines covered (74.03%)

4.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.17
/handler.py


Source Not Available

The file "handler.py" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc