Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zappa/Zappa
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master@{1day}
Choose a base ref
...
head repository: zappa/Zappa
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 1 commit
  • 3 files changed
  • 2 contributors

Commits on Jun 5, 2026

  1. 🐛 Fix v2 custom-domain double-stage redirect with path-segment-safe s…

    …tage detection (#1409) (#1460)
    
    * 🐛 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.
    
    * 🐛 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>
    monkut and storkwrangler authored Jun 5, 2026
    Configuration menu
    Copy the full SHA
    5e9c6b7 View commit details
    Browse the repository at this point in the history
Loading