summaryrefslogtreecommitdiff
path: root/lisp/url
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2015-12-25 20:21:46 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2015-12-25 20:22:02 +0100
commit24228d28dc97ca924a36f249365ad183ca4836c7 (patch)
tree1735a11bb2c9890800300096b01ba9387f9604c2 /lisp/url
parentf41c54b7633c797ebbf5becc5d1cf94fe2494a62 (diff)
downloademacs-24228d28dc97ca924a36f249365ad183ca4836c7.tar.gz
Allow http://user:pass@foo/ URLs again
* lisp/url/url-auth.el (url-basic-auth): Allow explicit user/passwords in URLs (bug#19046). Backport: (cherry picked from commit b563715a2db265517d5a77f165a42afa1e233fdd)
Diffstat (limited to 'lisp/url')
-rw-r--r--lisp/url/url-auth.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index 31c15329ac6..75a9e387847 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -80,6 +80,9 @@ instead of the filename inheritance method."
byserv (cdr-safe (assoc server
(symbol-value url-basic-auth-storage))))
(cond
+ ((and user pass)
+ ;; Explicit http://user:pass@foo/ URL. Just return the credentials.
+ (setq retval (base64-encode-string (format "%s:%s" user pass))))
((and prompt (not byserv))
(setq user (or
(url-do-auth-source-search server type :user)