emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 7071410 4/8: Store CONTENT-TYPE header - don't skip it


From: Stefan Monnier
Subject: [elpa] master 7071410 4/8: Store CONTENT-TYPE header - don't skip it
Date: Mon, 30 Mar 2020 09:06:29 -0400 (EDT)

branch: master
commit 7071410964c9bd7bd93ff7896d0065b2ac8d025b
Author: jcaw <address@hidden>
Commit: jcaw <address@hidden>

    Store CONTENT-TYPE header - don't skip it
    
    Necessary so that request bodies can be parsed - the programmer needs to 
know
    the content-type to decode it.
    
    Better to store all headers anyway (don't know what the user will want to do
    with them). Don't discard them, even if `web-server` is done with them.
---
 web-server.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/web-server.el b/web-server.el
index bd0460c..d02b484 100644
--- a/web-server.el
+++ b/web-server.el
@@ -302,13 +302,13 @@ Return non-nil only when parsing is complete."
                   ;; will require special parsing.  Thus we will note
                   ;; the type in the CONTEXT variable for parsing
                   ;; dispatch above.
-                  (if (and (caar header) (eql (caar header) :CONTENT-TYPE))
-                      (cl-destructuring-bind (type &rest data)
-                          (mail-header-parse-content-type (cdar header))
-                        (setq boundary (cdr (assoc 'boundary data)))
-                        (setq context (intern (downcase type))))
-                    ;; All other headers are collected directly.
-                    (setcdr (last headers) header)))))
+                  (when (and (caar header) (eql (caar header) :CONTENT-TYPE))
+                    (cl-destructuring-bind (type &rest data)
+                        (mail-header-parse-content-type (cdar header))
+                      (setq boundary (cdr (assoc 'boundary data)))
+                      (setq context (intern (downcase type)))))
+                  ;; All other headers are collected directly.
+                  (setcdr (last headers) header))))
             (setq index tmp)))))
     (setf (active request) nil)
     nil))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]