Commit e66f981
committed
fix(fake): prevent panic in StreamCopy when client disconnects
- Add recover() in goroutine to handle panics when ResponseWriter
becomes invalid after client disconnect
- Check context before starting new goroutines
- Add type assertion with fallback for writers without ReaderFrom
Assisted-By: cagent1 parent 7a96bbb commit e66f981
1 file changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
399 | 404 | | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
403 | 408 | | |
404 | 409 | | |
405 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
406 | 416 | | |
407 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
408 | 425 | | |
409 | 426 | | |
410 | 427 | | |
| |||
0 commit comments