mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
* 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).