Mercurial > emacs
comparison lisp/url/url-http.el @ 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 | 1fdf9fc79e3e |
children | 3aa49a5ae0ce |
comparison
equal
deleted
inserted
replaced
76859:8fca90acf555 | 76860:5a7d99e3ab6d |
---|---|
379 | 379 |
380 (defun url-http-handle-cookies () | 380 (defun url-http-handle-cookies () |
381 "Handle all set-cookie / set-cookie2 headers in an HTTP response. | 381 "Handle all set-cookie / set-cookie2 headers in an HTTP response. |
382 The buffer must already be narrowed to the headers, so `mail-fetch-field' will | 382 The buffer must already be narrowed to the headers, so `mail-fetch-field' will |
383 work correctly." | 383 work correctly." |
384 (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t)) | 384 (let ((cookies (nreverse (mail-fetch-field "Set-Cookie" nil nil t))) |
385 (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t))) | 385 (cookies2 (nreverse (mail-fetch-field "Set-Cookie2" nil nil t)))) |
386 (and cookies (url-http-debug "Found %d Set-Cookie headers" (length cookies))) | 386 (and cookies (url-http-debug "Found %d Set-Cookie headers" (length cookies))) |
387 (and cookies2 (url-http-debug "Found %d Set-Cookie2 headers" (length cookies2))) | 387 (and cookies2 (url-http-debug "Found %d Set-Cookie2 headers" (length cookies2))) |
388 (while cookies | 388 (while cookies |
389 (url-cookie-handle-set-cookie (pop cookies))) | 389 (url-cookie-handle-set-cookie (pop cookies))) |
390 ;;; (while cookies2 | 390 ;;; (while cookies2 |