Skip to content

Commit b354ade

Browse files
committed
fix multipart data parsing
1 parent ca00b3f commit b354ade

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/body.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (b *Body) SanitizedMultipartForm() string {
7373
return string(b.Content)
7474
}
7575
boundary := matches[1]
76-
parts := bytes.Split(b.Content, []byte(boundary))
76+
parts := bytes.Split(b.Content, []byte("--"+boundary))
7777

7878
for i, p := range parts {
7979
fileMatches := multipartFileRE.FindSubmatch(p)
@@ -83,6 +83,6 @@ func (b *Body) SanitizedMultipartForm() string {
8383
}
8484
}
8585

86-
out := string(bytes.Join(parts, []byte(boundary)))
86+
out := string(bytes.Join(parts, []byte("--"+boundary)))
8787
return strings.Replace(out, "\n", "\n ", -1)
8888
}

0 commit comments

Comments
 (0)