Commit 1200c1a
Seed context 'match' to null at the top of runInternal
Previously 'match' was only set after Http::match() ran (or by execute()
when called directly). Code that read it earlier — request hooks, the
global error path triggered by an exception in a request hook,
top-level introspection in app/http.php — got "Failed to find resource"
from getResource('match').
Set it to null up front, alongside 'request' and 'response', so
inject('match') and getResource('match') always return at least null
during a request. The real RouteMatch overwrites it once routing
resolves.
Added testMatchIsNullDuringEarlyErrorBeforeRouting covering the
"error in onRequest hook -> global error handler reads 'match'"
path that motivated this fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e6ffc47 commit 1200c1a
2 files changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
790 | 795 | | |
791 | 796 | | |
792 | 797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
398 | 427 | | |
399 | 428 | | |
400 | 429 | | |
| |||
0 commit comments