Files
LocalAI/core/http/endpoints
Ettore Di Giacinto 88306d562d fix(distributed): set node header before first byte on streaming error path
In the chat.go error-from-worker branch the call to applyNodeIDHeader
came after fmt.Fprintf had already written to the response writer.
Go's http.ResponseWriter commits headers on the first Write, so the
X-LocalAI-Node header was silently dropped on streaming error
responses. Move the call before each Fprintf so the header is set on
both the marshal-error and the normal-error paths.

The non-streaming chat path and the completion error path were
already correctly ordered.

Assisted-by: Claude:claude-opus-4-7[1m]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2026-05-24 21:03:19 +00:00
..