Commit 31cd90fb authored by Alessio Caiazza's avatar Alessio Caiazza

Merge branch 'jv-workhorse-seek' into 'master'

Add missing error returns

See merge request gitlab-org/gitlab!59499
parents e6542f12 5440c987
...@@ -192,7 +192,10 @@ func handleExifUpload(ctx context.Context, r io.Reader, filename string, imageTy ...@@ -192,7 +192,10 @@ func handleExifUpload(ctx context.Context, r io.Reader, filename string, imageTy
return nil, err return nil, err
} }
tmpfile.Seek(0, io.SeekStart) if _, err := tmpfile.Seek(0, io.SeekStart); err != nil {
return nil, err
}
isValidType := false isValidType := false
switch imageType { switch imageType {
case exif.TypeJPEG: case exif.TypeJPEG:
...@@ -201,7 +204,10 @@ func handleExifUpload(ctx context.Context, r io.Reader, filename string, imageTy ...@@ -201,7 +204,10 @@ func handleExifUpload(ctx context.Context, r io.Reader, filename string, imageTy
isValidType = isTIFF(tmpfile) isValidType = isTIFF(tmpfile)
} }
tmpfile.Seek(0, io.SeekStart) if _, err := tmpfile.Seek(0, io.SeekStart); err != nil {
return nil, err
}
if !isValidType { if !isValidType {
log.WithContextFields(ctx, log.Fields{ log.WithContextFields(ctx, log.Fields{
"filename": filename, "filename": filename,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment