fix: seek after mime read

This commit is contained in:
Derrick Hammer 2024-03-29 12:29:57 -04:00
parent 8ccd90825b
commit d913e0f7b2
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 0 deletions

View File

@ -2007,6 +2007,12 @@ func (s *S5API) downloadFile(jc jape.Context) {
return return
} }
mimeType = detectedType.String() mimeType = detectedType.String()
_, err = file.Seek(0, io.SeekStart)
if err != nil {
s.logger.Error("error seeking file", zap.Error(err))
_ = jc.Error(err, http.StatusInternalServerError)
return
}
} }
if len(mimeType) == 0 { if len(mimeType) == 0 {