mirror of
https://github.com/mudler/LocalAI.git
synced 2026-05-31 12:07:45 -04:00
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>