]> git.eshelyaron.com Git - emacs.git/commitdiff
In Message, respect Content-Type provided by the user
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 4 Jul 2019 14:08:22 +0000 (16:08 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 4 Jul 2019 14:08:22 +0000 (16:08 +0200)
* lisp/gnus/mml.el (mml-parse-1): Respect any Content-Type
inserted by the user instead of insisting on text/plain.

lisp/gnus/mml.el

index b664ebe3bf945853843cac8875374ee1a6530cbe..4a0d40ac0ed45dbc87d07ccbf4c0969bbf05e584 100644 (file)
@@ -295,6 +295,14 @@ part.  This is for the internal use, you should never modify the value.")
                        (t
                         (mm-find-mime-charset-region point (point)
                                                      mm-hack-charsets))))
+       ;; If the user has inserted a Content-Type header, then
+       ;; respect that instead of overwriting with "text/plain".
+       (save-restriction
+         (narrow-to-region point (point))
+         (let ((content-type (mail-fetch-field "content-type")))
+           (when (and content-type
+                      (eq (car tag) 'part))
+             (setcdr (assq 'type tag) content-type))))
        (when (and (not raw) (memq nil charsets))
          (if (or (memq 'unknown-encoding mml-confirmation-set)
                  (message-options-get 'unknown-encoding)