Files
sendico/api/server/internal/mutil/imagewriter/imagewriter.go
Stephan D 49b86efecb
Some checks failed
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/fx/1 Pipeline failed
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/fx/2 Pipeline failed
fx build fix
2025-11-08 00:30:29 +01:00

16 lines
313 B
Go

package imagewriter
import (
"net/http"
"strconv"
)
func WriteImage(w http.ResponseWriter, buffer *[]byte, fileType string) error {
w.Header().Set("Content-Type", fileType)
w.Header().Set("Content-Length", strconv.Itoa(len(*buffer)))
w.WriteHeader(http.StatusOK)
_, err := w.Write(*buffer)
return err
}