changeset 76860:5a7d99e3ab6d

(url-http-handle-cookies): Reverse list returned by `mail-fetch-field', so that cookies are set in the correct order.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 01 Apr 2007 15:39:13 +0000
parents 8fca90acf555
children 3f0c06049787
files lisp/url/url-http.el
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/url-http.el	Sun Apr 01 15:38:50 2007 +0000
+++ b/lisp/url/url-http.el	Sun Apr 01 15:39:13 2007 +0000
@@ -381,8 +381,8 @@
   "Handle all set-cookie / set-cookie2 headers in an HTTP response.
 The buffer must already be narrowed to the headers, so `mail-fetch-field' will
 work correctly."
-  (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t))
-	(cookies2 (mail-fetch-field "Set-Cookie2" nil nil t)))
+  (let ((cookies (nreverse (mail-fetch-field "Set-Cookie" nil nil t)))
+	(cookies2 (nreverse (mail-fetch-field "Set-Cookie2" nil nil t))))
     (and cookies (url-http-debug "Found %d Set-Cookie headers" (length cookies)))
     (and cookies2 (url-http-debug "Found %d Set-Cookie2 headers" (length cookies2)))
     (while cookies