Commit fcd9e14
fix: use byte-level search for split flight boundary
The previous implementation used string.indexOf() which returns
a character index, then used that index to slice a Uint8Array buffer.
This caused data corruption when the buffer contained multi-byte
UTF-8 characters (emoji, non-ASCII, etc.) because character indices
don't match byte indices.
Added findBoundaryIndex() helper that searches for the boundary
bytes directly in the buffer, ensuring correct splitting regardless
of UTF-8 encoding.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent fa0fd78 commit fcd9e14
File tree
1 file changed
+28
-4
lines changed- packages/next/src/client/components/router-reducer
1 file changed
+28
-4
lines changedLines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
507 | 533 | | |
508 | 534 | | |
509 | 535 | | |
| |||
520 | 546 | | |
521 | 547 | | |
522 | 548 | | |
523 | | - | |
524 | 549 | | |
525 | 550 | | |
526 | 551 | | |
| |||
540 | 565 | | |
541 | 566 | | |
542 | 567 | | |
543 | | - | |
544 | | - | |
545 | | - | |
| 568 | + | |
| 569 | + | |
546 | 570 | | |
547 | 571 | | |
548 | 572 | | |
| |||
0 commit comments