Skip to content

Releases: mathsgod/light-server

v1.4.0

Choose a tag to compare

@mathsgod mathsgod released this 01 Sep 05:17
ce6941e

What's Changed

  • feat: normalize file-based page routes by @mathsgod in #1

New Contributors

Full Changelog: v1.3.0...v1.4.0

v1.3.0

Choose a tag to compare

@mathsgod mathsgod released this 20 Jul 03:46

What's changed

  • Add HEAD request support with automatic GET fallback and empty response bodies.
  • Improve dependency injection for defaults, nullable parameters, scalar types, union types, and unresolved dependencies.
  • Support pages/ at the project root when using public/index.php.
  • Support custom options() handlers and distinguish normal OPTIONS requests from CORS preflight requests.
  • Harden CORS configuration by rejecting wildcard origins with credentials and preserving Vary: Origin.

Verification

  • PHPUnit: 37 tests, 64 assertions passing.

v1.2.1

Choose a tag to compare

@mathsgod mathsgod released this 01 Jun 03:00
  • Fix error handler to respect error_reporting() level, allowing suppressed errors (e.g. E_USER_DEPRECATED) to be silently ignored instead of thrown as ErrorException

v1.2.0

Choose a tag to compare

@mathsgod mathsgod released this 29 May 03:20

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

1.1.0

Choose a tag to compare

@mathsgod mathsgod released this 31 Dec 07:27

Full Changelog: 1.0.4...1.1.0

1.0.5: ✨ fix(MethodMiddleware): 修正輸出處理以正確返回文本響應

Choose a tag to compare

@mathsgod mathsgod released this 30 Dec 09:33
* 在 `process` 方法中,將 `ob_get_clean()` 的結果賦值給 `$output` 變數。
* 確保當返回值不是 `ResponseInterface` 時,能夠正確返回 `TextResponse`。

1.0.4

Choose a tag to compare

@mathsgod mathsgod released this 15 Apr 04:31

Full Changelog: 1.0.3...1.0.4

1.0.3

Choose a tag to compare

@mathsgod mathsgod released this 28 Mar 05:00

Full Changelog: 1.0.2...1.0.3

1.0.2

Choose a tag to compare

@mathsgod mathsgod released this 27 Mar 08:32

Full Changelog: 1.0.1...1.0.2

1.0.1

Choose a tag to compare

@mathsgod mathsgod released this 24 Mar 04:27

Full Changelog: 1.0.0...1.0.1