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

zappa / Zappa / 19216921182

10 Nov 2025 12:33AM UTC coverage: 72.615% (+0.2%) from 72.374%
19216921182

push

github

web-flow
:sparkles: API Gateway v2 (HTTP API) Configuration Support (#1391)

* :wrench: Move Policy files definitions to files:assume_policy.json, attach_policy.json
:wrench: Added constant: DEFAULT_APIGATEWAY_VERSION = "v1" in zappa/core.py:94

* 🐛 Fix API Gateway v2 double stage prefix bug in SCRIPT_NAME

  API Gateway v2's rawPath already includes the stage name (e.g., "/dev/path"),
  unlike v1 which excludes it. The existing logic incorrectly added the stage
  to SCRIPT_NAME for v2 events, causing Flask to build URLs with doubled prefixes
  (e.g., "/dev/dev/path" instead of "/dev/path").

  Changes:
  - Remove SCRIPT_NAME stage prefix logic for API Gateway v2 events
  - Keep stage prefix logic for v1 events (backward compatibility)
  - Add test cases demonstrating the bug and fix:
    - test_wsgi_script_name_on_v2_formatted_event_with_stage_in_path
    - test_wsgi_environ_shows_double_prefix_bug (debug test)
  - Add debug endpoint /dev/debug/wsgi/environ to inspect WSGI values
  - Update test_settings.json with proper apigateway_v2 configuration
  - Apply f-string formatting consistency in handler.py

* :wrench: fixes after testing actual app deployment for v1, v2 and function_urls.

* :white_check_mark: fix testcases

---------

Co-authored-by: shane <shane.cousins@kiconiaworks.com>

3060 of 4214 relevant lines covered (72.62%)

3.63 hits per line

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

78.55
/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