eschulte pushed a commit to branch master
in repository elpa.

commit d027ea069925440170f2fa41ba734e39a43ff297
Author: Eric Schulte <[email protected]>
Date:   Wed Dec 18 19:58:45 2013 -0700

    more lenient parsing of multipart forms
---
 emacs-web-server.el |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/emacs-web-server.el b/emacs-web-server.el
index dbeaf01..4d3bfbe 100644
--- a/emacs-web-server.el
+++ b/emacs-web-server.el
@@ -118,9 +118,8 @@ function.
   string)
 
 (defun ews-parse-multipart/form (string)
-  (when (string-match "[^[:space:]]" string) ; ignore empty
-    (unless (string-match "Content-Disposition:[[:space:]]*\\(.*\\)\r\n" 
string)
-      (error "missing Content-Disposition for multipart/form element."))
+  ;; ignore empty and non-content blocks
+  (when (string-match "Content-Disposition:[[:space:]]*\\(.*\\)\r\n" string)
     (let ((dp (mail-header-parse-content-disposition (match-string 1 string))))
       (cons (cdr (assoc 'name (cdr dp)))
             (cons (cons 'content (ews-trim (substring string (match-end 0))))

Reply via email to