fix: temporarily write blob directly as response body without http.ServeContent
All checks were successful
arcad/edge/pipeline/head This commit looks good

This commit is contained in:
wpetit 2023-12-05 14:18:22 +01:00
parent b120e590b6
commit 753a6c9708

View File

@ -2,6 +2,7 @@ package blob
import (
"encoding/json"
"io"
"io/fs"
"mime/multipart"
"net/http"
@ -164,7 +165,14 @@ func handleAppDownload(w http.ResponseWriter, r *http.Request) {
}
}()
http.ServeContent(w, r, string(replyMessage.BlobInfo.ID()), replyMessage.BlobInfo.ModTime(), replyMessage.Blob)
// TODO Fix usage of ServeContent
// http.ServeContent(w, r, string(replyMessage.BlobInfo.ID()), replyMessage.BlobInfo.ModTime(), replyMessage.Blob)
w.Header().Add("Content-Type", replyMessage.BlobInfo.ContentType())
if _, err := io.Copy(w, replyMessage.Blob); err != nil {
logger.Error(ctx, "could not write blob", logger.CapturedE(errors.WithStack(err)))
}
}
type uploadedFile struct {