Commit 2759a95
committed
fix: prevent TransferEncodingError in Gemini/Claude SSE streams
Convert yield Err(...) to yield Ok(Bytes::from(...)) with properly
formatted SSE error events. Yielding Err into Body::from_stream()
causes axum/hyper to abort the HTTP response with a TransferEncoding
error instead of delivering the error as a valid SSE data frame.
Files changed:
- src-tauri/src/proxy/handlers/gemini.rs (primary fix)
- src-tauri/src/proxy/mappers/claude/mod.rs (defense-in-depth)1 parent 4fd9112 commit 2759a95
2 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
0 commit comments