Compare commits
No commits in common. "d913e0f7b245241ed5353a3329791f856dbbfcd8" and "09c9ab8614d499cfcc6ba6453cdb90bd4498def5" have entirely different histories.
d913e0f7b2
...
09c9ab8614
|
@ -2003,16 +2003,9 @@ func (s *S5API) downloadFile(jc jape.Context) {
|
|||
detectedType, err := mimetype.DetectReader(file)
|
||||
if err != nil {
|
||||
s.logger.Error("error detecting mime type", zap.Error(err))
|
||||
_ = jc.Error(err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
_ = jc.Error(err, http.StatusInternalServerError)
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue