From d8ea9b3afd43e91cf89ff4bdcf8924a68a51a1e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 21:11:29 +0000 Subject: [PATCH] fix: do not call path.Base on ContentType (#225) --- internal/apiform/encoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/apiform/encoder.go b/internal/apiform/encoder.go index 58905ea..555330a 100644 --- a/internal/apiform/encoder.go +++ b/internal/apiform/encoder.go @@ -319,7 +319,7 @@ func (e *encoder) newReaderTypeEncoder() encoderFunc { filename = path.Base(named.Name()) } if typed, ok := reader.(interface{ ContentType() string }); ok { - contentType = path.Base(typed.ContentType()) + contentType = typed.ContentType() } // Below is taken almost 1-for-1 from [multipart.CreateFormFile]