mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-12 12:49:07 +02:00
chore(deps): update golangci-lint (#1833)
This commit is contained in:
@@ -759,12 +759,12 @@ func (s *Service) saveProfilePicture(parentCtx context.Context, userId string, p
|
||||
|
||||
const maxProfilePictureSize int64 = 2 * 1024 * 1024 // 2MB
|
||||
if res.ContentLength > maxProfilePictureSize {
|
||||
return fmt.Errorf("profile picture must not exceed 2 MB")
|
||||
return errors.New("profile picture must not exceed 2 MB")
|
||||
}
|
||||
|
||||
data, err := io.ReadAll(utils.NewLimitReader(res.Body, maxProfilePictureSize+1))
|
||||
if errors.Is(err, utils.ErrSizeExceeded) {
|
||||
return fmt.Errorf("profile picture must not exceed 2 MB")
|
||||
return errors.New("profile picture must not exceed 2 MB")
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("failed to read profile picture: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user