MCPcopy
hub / github.com/mudler/LocalAI / forwardBuffered

Function forwardBuffered

core/services/cloudproxy/proxy.go:53–60  ·  view source on GitHub ↗
(c echo.Context, statusCode int, contentType string, body io.Reader)

Source from the content-addressed store, hash-verified

51}
52
53func forwardBuffered(c echo.Context, statusCode int, contentType string, body io.Reader) error {
54 if contentType != "" {
55 c.Response().Header().Set("Content-Type", contentType)
56 }
57 c.Response().WriteHeader(statusCode)
58 _, err := io.Copy(c.Response().Writer, body)
59 return err
60}
61
62// forwardStream relays the upstream SSE response to the client,
63// flushing per read so events arrive in real time. Response/output PII

Callers 1

ForwardViaBackendFunction · 0.85

Calls 3

HeaderMethod · 0.80
SetMethod · 0.65
WriteHeaderMethod · 0.45

Tested by

no test coverage detected