changeset 105905:57dbd4754360

* url-http.el (url-http-handle-authentication): Use proxy server, if any, for authentication (Bug#4883).
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 08 Nov 2009 05:32:48 +0000
parents f49caf3c20c7
children a061342b5097
files lisp/url/ChangeLog lisp/url/url-http.el
diffstat 2 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/ChangeLog	Sun Nov 08 00:32:18 2009 +0000
+++ b/lisp/url/ChangeLog	Sun Nov 08 05:32:48 2009 +0000
@@ -1,3 +1,8 @@
+2009-11-08  Kai Tetzlaff  <kai.tetzlaff@web.de>  (tiny change)
+
+	* url-http.el (url-http-handle-authentication): Use proxy server,
+	if any, for authentication (Bug#4883).
+
 2009-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* url-util.el (url-insert-entities-in-string):
--- a/lisp/url/url-http.el	Sun Nov 08 00:32:18 2009 +0000
+++ b/lisp/url/url-http.el	Sun Nov 08 05:32:48 2009 +0000
@@ -315,12 +315,16 @@
 		  '("basic")))
 	(type nil)
 	(url (url-recreate-url url-current-object))
-	(url-basic-auth-storage 'url-http-real-basic-auth-storage)
+	(auth-url (url-recreate-url
+		   (if (and proxy (boundp 'url-http-proxy))
+		       url-http-proxy
+		     url-current-object)))
+	(url-basic-auth-storage (if proxy
+				    ;; Cheating, but who cares? :)
+				    'url-http-proxy-basic-auth-storage
+				  'url-http-real-basic-auth-storage))
 	auth
 	(strength 0))
-    ;; Cheating, but who cares? :)
-    (if proxy
-	(setq url-basic-auth-storage 'url-http-proxy-basic-auth-storage))
 
     ;; find strongest supported auth
     (dolist (this-auth auths)
@@ -347,7 +351,8 @@
 		  " send it to " url-bug-address ".<hr>")
 	  (setq status t))
       (let* ((args (url-parse-args (subst-char-in-string ?, ?\; auth)))
-	     (auth (url-get-authentication url (cdr-safe (assoc "realm" args))
+	     (auth (url-get-authentication auth-url
+					   (cdr-safe (assoc "realm" args))
 					   type t args)))
 	(if (not auth)
 	    (setq success t)