]> git.eshelyaron.com Git - emacs.git/commitdiff
When submitting files in EWW, only send the file's basename
authorDaniel Watson <ozzloy@each.do>
Tue, 12 Sep 2023 07:06:14 +0000 (00:06 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 8 Nov 2024 13:34:49 +0000 (14:34 +0100)
* lisp/net/eww.el (eww-submit): Send the basename, not the full
filename (bug#65973).

Copyright-paperwork-exempt: yes
(cherry picked from commit f6b55678d76a7b549993d629672a4f33d269dbd8)

lisp/net/eww.el

index d33604038cbcdb137f53b329e839b2210968981f..43411cc640f87b1669982d59658cc096108b98a6 100644 (file)
@@ -2066,7 +2066,11 @@ Interactively, EVENT is the value of `last-nonmenu-event'."
                                   (insert-file-contents file)
                                   (buffer-string)))
                           (cons "name" name)
-                          (cons "filename" file))
+                          ;; RFC 2183 declares that recipients should
+                          ;; only respect the basename of the filename
+                          ;; parameter, so we only send that portion in
+                          ;; our request.
+                          (cons "filename" (file-name-nondirectory file)))
                     values)))
           ((equal (plist-get input :type) "submit")
            ;; We want the values from buttons if we hit a button if