Repository navigation
v1.7.9: Add comprehensive CORS preflight handling and module middleware support
CORS Improvements:
- Add automatic OPTIONS preflight handling with 204 response
- Implement dynamic origin validation with sync/async function support
- Add origin rejection with 403 status for failed validation
- Support string, array, boolean, and function origin types
- Add preflightContinue option for manual preflight handling
- Add comprehensive CORS tests (26 tests, all passing)
Module Middleware:
- Add module-level middleware (applied to all routes in module)
- Add route-level middleware (applied to specific routes)
- Support middleware as string names or functions
- Add middleware resolution from MiddlewareManager and builtInMiddleware
- Implement proper execution order: global → module → route → handler
- Add safe middleware getter to MiddlewareManager
- Add comprehensive module middleware tests (12 tests, all passing)
Documentation:
- Update MIDDLEWARE_GUIDE.md with CORS dynamic origin examples
- Update API.md with CORS function examples
- Update CONFIGURATION_REFERENCE.md with CORS options
- Update MODULES_GUIDE.md with complete middleware section
- Add execution order and built-in middleware reference
Breaking Changes: None
All 604 tests passing
Backward compatible