emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 655fe3f 1/2: Fix long credentials when using auth i


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 655fe3f 1/2: Fix long credentials when using auth in url.el
Date: Fri, 12 Jul 2019 19:31:31 -0400 (EDT)

branch: master
commit 655fe3fe0de92ace4a97dd3c478c3683b163e132
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix long credentials when using auth in url.el
    
    * lisp/url/url-auth.el (url-basic-auth): When base64-ing
    credentials, don't let bsae64-encode-string split the result into
    several lines, because servers do not understand that (bug#36619).
---
 lisp/url/url-auth.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index beed7c6..b78544e 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -82,7 +82,7 @@ instead of the filename inheritance method."
     (cond
      ((and user pass)
       ;; Explicit http://user:pass@foo/ URL.  Just return the credentials.
-      (setq retval (base64-encode-string (format "%s:%s" user pass))))
+      (setq retval (base64-encode-string (format "%s:%s" user pass) t)))
      ((and prompt (not byserv))
       (setq user (or
                  (url-do-auth-source-search server type :user)
@@ -97,7 +97,8 @@ instead of the filename inheritance method."
                             (setq retval
                                   (base64-encode-string
                                    (format "%s:%s" user
-                                           (encode-coding-string pass 
'utf-8))))))
+                                           (encode-coding-string pass 'utf-8))
+                                    t))))
                 (symbol-value url-basic-auth-storage))))
      (byserv
       (setq retval (cdr-safe (assoc file byserv)))
@@ -120,7 +121,7 @@ instead of the filename inheritance method."
                  pass (or
                        (url-do-auth-source-search server type :secret)
                        (read-passwd "Password: "))
-                 retval (base64-encode-string (format "%s:%s" user pass))
+                 retval (base64-encode-string (format "%s:%s" user pass) t)
                  byserv (assoc server (symbol-value url-basic-auth-storage)))
            (setcdr byserv
                    (cons (cons file retval) (cdr byserv))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]