GNU bug report logs - #32983
27.0.50; soap-client shall accept "multipart/related" Content-type

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Mon, 8 Oct 2018 09:04:01 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Fixed in version 27.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: 32983 <at> debbugs.gnu.org
Subject: bug#32983: 27.0.50; soap-client shall accept "multipart/related" Content-type
Date: Mon, 08 Oct 2018 11:07:44 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> The soap-client checks HTTPS responses for a proper Content-type
> "text/xml". However, not all SOAP servers return this. For example, the
> Perl SOAP::Lite module returns sometimes the Content-type
> "multipart/related". As an example one could load the GNU ELPA package
> debbugs, and eval the form (debbugs-get-bug-log 25235)
>
> This shall be supported by soap-client.

The following patch works for me. Shall be reviewed by the soap-client
maintainers.

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index f5de05dc3d..5c819636e6 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -2337,6 +2337,14 @@ soap-wsdl-resolve-references
 (defun soap-parse-server-response ()
   "Error-check and parse the XML contents of the current buffer."
   (let ((mime-part (mm-dissect-buffer t t)))
+    (when (and
+           (equal (mm-handle-media-type mime-part) "multipart/related")
+           (equal (get-text-property 0 'type (mm-handle-media-type mime-part))
+                  "text/xml"))
+      (setq mime-part
+            (mm-make-handle
+             (get-text-property 0 'buffer (mm-handle-media-type mime-part))
+             `(,(get-text-property 0 'type (mm-handle-media-type mime-part))))))
     (unless mime-part
       (error "Failed to decode response from server"))
     (unless (equal (car (mm-handle-type mime-part)) "text/xml")
--8<---------------cut here---------------end--------------->8---





This bug report was last modified 6 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.