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

zappa / Zappa / 26996829987

05 Jun 2026 05:14AM UTC coverage: 74.785% (+0.01%) from 74.775%
26996829987

push

github

web-flow
:bug: Fix v2 custom-domain double-stage redirect with path-segment-safe stage detection (#1409) (#1460)

* :bug: Fix double stage redirect with V2 custom domain mapping (#1409)

When a custom domain maps to an API Gateway v2 stage, API Gateway strips
the stage prefix from rawPath before invoking Lambda. But the handler
always set SCRIPT_NAME to /{stage}, causing Django to construct redirect
URLs with a duplicated stage (e.g., /dev/dev/admin/).

Now detects whether rawPath actually starts with the stage prefix.
If not (custom domain case), SCRIPT_NAME is left empty so redirects
produce correct URLs without the stage prefix.

* :bug: Match v2 stage on path-segment boundary to avoid stripping lookalike routes (#1409)

Harden the API Gateway v2 custom-domain detection so a route whose top path
segment merely shares a leading substring with the stage name (e.g. stage
"prod" + path "/products") is not mistaken for direct API Gateway access.
The stage is now matched on a path-segment boundary (exact match or
"/{stage}/" prefix) instead of a bare string prefix.

Add regression tests covering the custom-domain lookalike-route case.

---------

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

3657 of 4890 relevant lines covered (74.79%)

4.49 hits per line

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

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