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

This commit is contained in:
wpetit 2023-12-05 14:18:22 +01:00
parent b120e590b6
commit 753a6c9708
1 changed files with 9 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package blob
import ( import (
"encoding/json" "encoding/json"
"io"
"io/fs" "io/fs"
"mime/multipart" "mime/multipart"
"net/http" "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 { type uploadedFile struct {