From: Satoshi Nakagawa Date: Sun, 19 Jul 2020 19:12:08 +0000 (+0200) Subject: Support Proxy-Authorization in HTTPS CONNECT proxies X-Git-Tag: emacs-28.0.90~6965 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f8f3e77fa83a3a97e5a0de8a7c75092cadf82627;p=emacs.git 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 --- diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 669c24571f9..c8a2da05469 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))