fix(llm_gateway): use envoy body_size for response body replacement

Co-authored-by: Musa <musa@spherrrical.dev>
This commit is contained in:
Cursor Agent 2026-05-18 18:35:52 +00:00
parent 0348ca1d11
commit 60da45a6ee
No known key found for this signature in database

View file

@ -1206,7 +1206,7 @@ impl HttpContext for StreamContext {
String::from_utf8_lossy(&body)
);
// Forward the error response as-is
let replace_size = if self.streaming_response {
let replace_size = if body_size > 0 {
body_size
} else {
body.len()
@ -1248,7 +1248,7 @@ impl HttpContext for StreamContext {
return Action::Continue;
}
let replace_size = if self.streaming_response {
let replace_size = if body_size > 0 {
body_size
} else {
body.len()