Skip to content

v1.2.0

Choose a tag to compare

@mathsgod mathsgod released this 29 May 03:20
· 12 commits to main since this release

What's New

πŸ†• Features

  • CorsMiddleware β€” built-in CORS preflight handling; OPTIONS requests intercepted before routing, returns 204 with CORS headers; all other requests get CORS headers appended
  • SecurityHeadersMiddleware β€” adds common security response headers (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, Referrer-Policy, CSP)
  • Graceful missing pages/ directory β€” server starts normally with no routes instead of crashing

πŸ”§ Improvements

  • PHP 8.1 type hints across all source files
  • strict_types=1 added to MethodMiddleware.php
  • Extracted resolveRoutePath() method in Server.php for cleaner route registration
  • Improved test coverage: 24 tests, 38 assertions

πŸ› Bug Fixes

  • Fixed ReflectionUnionType::getName() fatal error on union type parameters
  • Fixed error_reporting(0) silencing errors β€” now throws ErrorException via set_error_handler()
  • Fixed double-slash routing when app is at web root
  • Fixed getRootPath() undefined index and inconsistent key usage

πŸ“– Documentation

  • Complete README rewrite with routing table, DI docs, attribute middleware, route constraints, and CORS middleware sections
  • Added description to composer.json