Repository navigation
Commit 97f09f4
committed
fix(start-server-core): guard against undefined ctx.response in HEAD fallback
If a fallback GET/ANY handler exits without returning a Response, ctx.response
is undefined. Without the guard, handleRedirectResponse passes undefined through
and new Response(null, undefined) silently synthesizes a 200 OK, masking the
handler bug. Calling throwRouteHandlerError() surfaces the mistake with the same
error used everywhere else in the file. Also removes the unsafe cast -- TypeScript
narrows the type correctly after the never-returning guard.1 parent 0d3549e commit 97f09f4
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
906 | | - | |
907 | | - | |
| 906 | + | |
| 907 | + | |
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
| |||
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
945 | 949 | | |
946 | | - | |
| 950 | + | |
947 | 951 | | |
948 | 952 | | |
949 | 953 | | |
| |||
0 commit comments