From cacfe88b03bd2e8538e8cf12c77b2f9c230c5302 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 30 Nov 2004 21:32:35 +0000 Subject: [PATCH] (url-http-handle-cookies): Bind `url-current-object' to `url-http-cookies-sources' so that cookies are attributed to proper domain. (url-http): Make local variable `url-http-cookies-sources'. --- lisp/url/ChangeLog | 7 +++++++ lisp/url/url-http.el | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 7a527f943e3..c9663baff8f 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,10 @@ +2004-11-30 Paul Pogonyshev + + * url-http.el (url-http-handle-cookies): Bind `url-current-object' + to `url-http-cookies-sources' so that cookies are attributed to + proper domain. + (url-http): Make local variable `url-http-cookies-sources'. + 2004-11-28 Andreas Schwab * url-http.el (url-http-create-request): Don't add newline after diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index a3fd54e3cba..8a7269e6bea 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -342,7 +342,8 @@ This allows us to use `mail-fetch-field', etc." 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))) + (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t)) + (url-current-object url-http-cookies-sources)) (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 @@ -1043,7 +1044,8 @@ CBARGS as the arguments." url-http-process url-http-method url-http-extra-headers - url-http-data)) + url-http-data + url-http-cookies-sources)) (set (make-local-variable var) nil)) (setq url-http-method (or url-request-method "GET") @@ -1055,7 +1057,10 @@ CBARGS as the arguments." url-http-chunked-counter 0 url-callback-function callback url-callback-arguments cbargs - url-http-after-change-function 'url-http-wait-for-headers-change-function) + url-http-after-change-function 'url-http-wait-for-headers-change-function + url-http-cookies-sources (if (boundp 'proxy-object) + proxy-object + url-current-object)) (set-process-buffer connection buffer) (set-process-sentinel connection 'url-http-end-of-document-sentinel)