From f74605793ef1595cbc139bee4a6ea18cabc498b8 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Fri, 26 Feb 2021 22:01:18 +0100 Subject: [PATCH] FindFirstNonMultipart: return the proper path There was a bug that lead to the wrong path being returned by the function. --- lib/structure_helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/structure_helpers.go b/lib/structure_helpers.go index 21159a2..4abf304 100644 --- a/lib/structure_helpers.go +++ b/lib/structure_helpers.go @@ -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