MCPcopy Create free account
hub / github.com/bricks-cloud/BricksLLM / writeFieldToBuffer

Function writeFieldToBuffer

internal/server/web/proxy/proxy.go:261–280  ·  view source on GitHub ↗
(fields []string, c *gin.Context, writer *multipart.Writer, overWrites map[string]string)

Source from the content-addressed store, hash-verified

259}
260
261func writeFieldToBuffer(fields []string, c *gin.Context, writer *multipart.Writer, overWrites map[string]string) error {
262 for _, field := range fields {
263 val := c.PostForm(field)
264
265 if len(overWrites) != 0 {
266 if ow := overWrites[field]; len(ow) != 0 {
267 val = ow
268 }
269 }
270
271 if len(val) != 0 {
272 err := writer.WriteField(field, val)
273 if err != nil {
274 return err
275 }
276 }
277 }
278
279 return nil
280}
281
282func getPassThroughHandler(prod, private bool, client http.Client) gin.HandlerFunc {
283 return func(c *gin.Context) {

Callers 3

getPassThroughHandlerFunction · 0.85
getTranscriptionsHandlerFunction · 0.85
getTranslationsHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected