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

View file

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