summaryrefslogtreecommitdiff
path: root/lisp/url/url-proxy.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
commit650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch)
tree85d11f6437cde22f410c25e0e5f71a3131ebd07d /lisp/url/url-proxy.el
parent8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff)
parent4b85ae6a24380fb67a3315eaec9233f17a872473 (diff)
downloademacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.bz2
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip
Merge 'master' into noverlay
Diffstat (limited to 'lisp/url/url-proxy.el')
-rw-r--r--lisp/url/url-proxy.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/url/url-proxy.el b/lisp/url/url-proxy.el
index 706cb689e4b..c72e459a4ec 100644
--- a/lisp/url/url-proxy.el
+++ b/lisp/url/url-proxy.el
@@ -1,6 +1,6 @@
-;;; url-proxy.el --- Proxy server support
+;;; url-proxy.el --- Proxy server support -*- lexical-binding: t; -*-
-;; Copyright (C) 1999, 2004-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2004-2022 Free Software Foundation, Inc.
;; Keywords: comm, data, processes, hypermedia
@@ -19,10 +19,11 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+;;; Commentary:
+
;;; Code:
(require 'url-parse)
-(autoload 'url-warn "url")
(defun url-default-find-proxy-for-url (urlobj host)
(cond
@@ -50,17 +51,15 @@
;; Not sure how I should handle gracefully degrading from one proxy to
;; another, so for now just deal with the first one
;; (while proxies
- (if (listp proxies)
- (setq proxy (car proxies))
- (setq proxy proxies))
+ (setq proxy (if (listp proxies) (car proxies) proxies))
(cond
- ((string-match "^direct" proxy) nil)
- ((string-match "^proxy +" proxy)
+ ((string-match "^DIRECT" proxy) nil)
+ ((string-match "^PROXY +" proxy)
(concat "http://" (substring proxy (match-end 0)) "/"))
- ((string-match "^socks +" proxy)
+ ((string-match "^SOCKS +" proxy)
(concat "socks://" (substring proxy (match-end 0))))
(t
- (url-warn 'url (format "Unknown proxy directive: %s" proxy) 'critical)
+ (display-warning 'url (format "Unknown proxy directive: %s" proxy) :error)
nil))))
(autoload 'url-http "url-http")