From 592b20c5619fcdd03c32e5e1a1913bc64cfdc53a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 15 Jan 2024 08:29:09 -0500 Subject: [PATCH] fix: check header for prefix/starts with --- protocols/s5/http.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/protocols/s5/http.go b/protocols/s5/http.go index 77ff107..e90e396 100644 --- a/protocols/s5/http.go +++ b/protocols/s5/http.go @@ -11,6 +11,7 @@ import ( "io" "mime/multipart" "net/http" + "strings" ) var ( @@ -41,8 +42,9 @@ func (h *HttpHandlerImpl) SmallFileUpload(jc *jape.Context) { buffer := bytes.NewBuffer(nil) r := jc.Request - // Check if the content type is multipart/form-data - if r.Header.Get("Content-Type") == "multipart/form-data" { + contentType := r.Header.Get("Content-Type") + + if strings.HasPrefix(contentType, "multipart/form-data") { // Parse the multipart form err := r.ParseMultipartForm(h.portal.Config().GetInt64("core.post-upload-limit"))