]> git.eshelyaron.com Git - emacs.git/commitdiff
(url-http-handle-cookies): Reverse list returned by
authorChong Yidong <cyd@stupidchicken.com>
Sun, 1 Apr 2007 15:39:13 +0000 (15:39 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 1 Apr 2007 15:39:13 +0000 (15:39 +0000)
`mail-fetch-field', so that cookies are set in the correct order.

lisp/url/url-http.el

index d83c827a6fb7a8af6bdde577b6dcbea25f58155a..10a6f2e7278acfe20dad69055c43148a084cbd27 100644 (file)
@@ -381,8 +381,8 @@ This allows us to use `mail-fetch-field', etc."
   "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