Subject: bug#63941: Fwd: bug#63941: [PATCH] ; always CRLF before non-first boundary in multipart form

From: daniel watson <[email-masked]>
Date: Sun, 23 Mar 2025 16:09:46 -0700

daniel watson <[email-masked]> writes:
> from all of that, it seems reasonable to me to only accept string, and
> raise deprecation for integer, and signal an error for everything else.

here's code to implement the above,

https://codeberg.org/ozzloy/emacs/commit/2874bccebed8cfbbc3aac7fe10da4cfae5066f2c
it is also in the attachment filedata-deprecate-signal-error.diff

diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el
index bad0f8ee6b9..7bf091079d4 100644
--- a/lisp/gnus/mm-url.el
+++ b/lisp/gnus/mm-url.el
@@ -430,7 +430,12 @@ mm-url-encode-multipart-form-data
 	      (insert filedata))
 	     ;; How can this possibly be useful?
 	     ((integerp filedata)
-	      (insert (number-to-string filedata))))))
+	      (display-warning
+	       'mm-url "Using integer for filedata is deprecated")
+	      (insert (number-to-string filedata)))
+	     (t
+	      (error "Invalid filedata type: expected string but got %S"
+		     (type-of filedata))))))
 	 ((equal name "submit")
 	  (insert
 	   "Content-Disposition: form-data; name=\"submit\"\r\n\r\nSubmit"))
commit 2874bccebed8cfbbc3aac7fe10da4cfae5066f2c
Author: daniel watson <[email-masked]>
Date:   Sun Mar 23 16:02:39 2025 -0700

    ; handle filedata of different types with deprecation or error
    
    lisp/gnus/mm-url.el (mm-url-encode-multipart-form-data)
    
    when filedata is of type string, handle normally.
    when filedata is of type integer, issue deprecation warning.
    when filedata is any other type, signal an error.