emacs-diffs
[Top][All Lists]
Advanced

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

master f8f3e77: Support Proxy-Authorization in HTTPS CONNECT proxies


From: Lars Ingebrigtsen
Subject: master f8f3e77: Support Proxy-Authorization in HTTPS CONNECT proxies
Date: Sun, 19 Jul 2020 15:12:24 -0400 (EDT)

branch: master
commit f8f3e77fa83a3a97e5a0de8a7c75092cadf82627
Author: Satoshi Nakagawa <ghnacker@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Support Proxy-Authorization in HTTPS CONNECT proxies
    
    * lisp/url/url-http.el (url-https-proxy-connect): Support CONNECT
    with Proxy-Authorization header (bug#42422).
    
    Copyright-paperwork-exempt: yes
---
 lisp/url/url-http.el | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 669c245..c8a2da0 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1404,13 +1404,22 @@ The return value of this function is the retrieval 
buffer."
 
 (defun url-https-proxy-connect (connection)
   (setq url-http-after-change-function 'url-https-proxy-after-change-function)
-  (process-send-string connection (format (concat "CONNECT %s:%d HTTP/1.1\r\n"
-                                                  "Host: %s\r\n"
-                                                  "\r\n")
-                                          (url-host url-current-object)
-                                          (or (url-port url-current-object)
-                                              url-https-default-port)
-                                          (url-host url-current-object))))
+  (process-send-string
+   connection
+   (format
+    (concat "CONNECT %s:%d HTTP/1.1\r\n"
+            "Host: %s\r\n"
+            (let ((proxy-auth (let ((url-basic-auth-storage
+                                     'url-http-proxy-basic-auth-storage))
+                                (url-get-authentication url-http-proxy nil
+                                                        'any nil))))
+              (and proxy-auth
+                   (concat "Proxy-Authorization: " proxy-auth "\r\n")))
+            "\r\n")
+    (url-host url-current-object)
+    (or (url-port url-current-object)
+        url-https-default-port)
+    (url-host url-current-object))))
 
 (defun url-https-proxy-after-change-function (_st _nd _length)
   (let* ((process-buffer (current-buffer))



reply via email to

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