Files
floci/src
been-there-done-that 4b6b99c1e5 fix(api-gateway): resolve sibling {proxy+} collision with longest-prefix matching (#811)
* fix(api-gateway): resolve sibling {proxy+} collision with longest-prefix matching

When multiple sibling {proxy+} resources exist (e.g. /auth/{proxy+}
and /products/{proxy+}), the first one registered always matched
every request regardless of the parent path. Now the proxy+ with
the longest parent prefix matching the request path is selected,
matching real AWS behaviour.

Closes #792

* test(api-gateway): add unit tests for proxy+ path matching

Add 7 focused tests for the matchResource method covering root proxy+,
sibling proxy+ routing, fallback behaviour, exact/template priority,
longest parent prefix, and no-match cases.

* fix(api-gateway): reject empty proxy+ segments and use cleaner path extraction

Adopt reviewer's suggestion: use substring before {proxy+} for parent
prefix extraction instead of lastIndexOf('/'), and require at least one
path segment after the prefix for non-root proxy+ resources. Root
/{proxy+} still matches / as a special case.

Adds tests for empty proxy segment edge case (/auth/ should not match
/auth/{proxy+}) and updates longestParentPrefixWins assertion for /api/
(should be null, not match).
2026-05-12 20:19:46 -05:00
..