FindFirstNonMultipart: return the proper path

There was a bug that lead to the wrong path being returned by the function.
This commit is contained in:
Reto Brunner 2021-02-26 22:01:18 +01:00
parent 8cd2485170
commit f74605793e
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ func FindFirstNonMultipart(bs *models.BodyStructure, path []int) []int {
cur := append(path, i+1)
mimetype := strings.ToLower(part.MIMEType)
if mimetype != "multipart" {
return path
return cur
} else if mimetype == "multipart" {
if path := FindFirstNonMultipart(part, cur); path != nil {
return path