Skip to content

Commit 53879d3

Browse files
authored
Improve error message when multipart submissions cannot be parsed (#108)
1 parent 21d52a0 commit 53879d3

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

changelog.d/108.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve HTTP error on malformed multipart submissions.

submit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func parseRequest(w http.ResponseWriter, req *http.Request, reportDir string, ma
304304
p, err1 := parseMultipartRequest(w, req, reportDir, maxloglines)
305305
if err1 != nil {
306306
log.Println("Error parsing multipart data:", err1)
307-
writeError(w, 400, submitErrorResponse{Error: "Bad multipart data", ErrorCode: ErrCodeBadContent})
307+
writeError(w, 400, submitErrorResponse{Error: fmt.Sprintf("Bad multipart data: %v", err1), ErrorCode: ErrCodeBadContent})
308308
return nil
309309
}
310310
return p

0 commit comments

Comments
 (0)