Commit 7b24eec
committed
fix: stop a boundary crash leaking its message, and formatting one from throwing
Two hazards and four comments that described a mechanism the code does not
have.
The 403 / 401 / 404 catches rendered the thrown value into the response body
in PRODUCTION, so a boundary that crashed leaked its error message to the
client. The 500 path has always drawn that line, because a thrown message is
not author-controlled. Those pages now show the detail in dev and the heading
alone in prod.
Both of those catches, and the dev branch of the default 500 page, also
stringified the thrown value unguarded. String(Object.create(null)) throws on
both runtimes, and all three run inside a catch whose job is to keep the
response alive, so formatting the failure could escape the handler and turn a
handled 500 into an unhandled one. One total formatter covers all three.
The comments claimed the dedup key is the full stack. It is the stage plus
the name, message and construction site, and the same block argues against a
full-stack key three lines later. Two test comments said the same thing, one
of them on the test that would fail under the mechanism it described.1 parent e2ac6d9 commit 7b24eec
2 files changed
Lines changed: 95 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
420 | 442 | | |
421 | 443 | | |
422 | 444 | | |
| |||
443 | 465 | | |
444 | 466 | | |
445 | 467 | | |
| 468 | + | |
446 | 469 | | |
447 | 470 | | |
448 | 471 | | |
| |||
656 | 679 | | |
657 | 680 | | |
658 | 681 | | |
659 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
660 | 689 | | |
661 | 690 | | |
662 | 691 | | |
| |||
708 | 737 | | |
709 | 738 | | |
710 | 739 | | |
711 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
712 | 743 | | |
713 | 744 | | |
714 | 745 | | |
| |||
1233 | 1264 | | |
1234 | 1265 | | |
1235 | 1266 | | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
| 1267 | + | |
1239 | 1268 | | |
1240 | 1269 | | |
1241 | 1270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2186 | 2186 | | |
2187 | 2187 | | |
2188 | 2188 | | |
2189 | | - | |
| 2189 | + | |
| 2190 | + | |
2190 | 2191 | | |
2191 | 2192 | | |
2192 | 2193 | | |
| |||
2334 | 2335 | | |
2335 | 2336 | | |
2336 | 2337 | | |
2337 | | - | |
2338 | | - | |
2339 | | - | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
2340 | 2342 | | |
2341 | 2343 | | |
2342 | 2344 | | |
| |||
2357 | 2359 | | |
2358 | 2360 | | |
2359 | 2361 | | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
2360 | 2415 | | |
2361 | 2416 | | |
2362 | 2417 | | |
| |||
0 commit comments