]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable background image fetching from asking for passwords
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 21 Jan 2022 14:22:24 +0000 (15:22 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 21 Jan 2022 14:22:24 +0000 (15:22 +0100)
* lisp/url/url-queue.el (url-queue-start-retrieve): Inhibit
prompting for passwords from these background requests.

lisp/url/url-queue.el

index 8741bca9423a3aa5b9571f4f873cba25d81ca9bc..d353f0c01179d61dd24de2a2e5c165d6e285f51f 100644 (file)
@@ -155,14 +155,19 @@ The variable `url-queue-timeout' sets a timeout."
 (defun url-queue-start-retrieve (job)
   (setf (url-queue-buffer job)
        (ignore-errors
-          (with-current-buffer (if (buffer-live-p (url-queue-context-buffer job))
+          (with-current-buffer (if (buffer-live-p
+                                    (url-queue-context-buffer job))
                                    (url-queue-context-buffer job)
                                  (current-buffer))
-          (let ((url-request-noninteractive t))
-             (url-retrieve (url-queue-url job)
-                           #'url-queue-callback-function (list job)
-                           (url-queue-silentp job)
-                           (url-queue-inhibit-cookiesp job)))))))
+           (let ((url-request-noninteractive t)
+                  ;; This will disable querying the user for
+                  ;; credentials if one of the things we're fetching
+                  ;; in the background return a header requesting it.
+                  (url-request-extra-headers '(("Authorization" . ""))))
+              (url-retrieve (url-queue-url job)
+                            #'url-queue-callback-function (list job)
+                            (url-queue-silentp job)
+                            (url-queue-inhibit-cookiesp job)))))))
 
 (defun url-queue-prune-old-entries ()
   (let (dead-jobs)