diff options
| author | Lars Ingebrigtsen | 2019-07-26 10:55:39 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-26 10:55:45 +0200 |
| commit | 64b469f6ae8173116ec948ac43cd44efe4b5a221 (patch) | |
| tree | a2da0a12881eb88fd3df868837bc5f5a97045374 | |
| parent | f462fcd1ff60d0abf780bafe11a8f228b4fffab2 (diff) | |
| download | emacs-64b469f6ae8173116ec948ac43cd44efe4b5a221.tar.gz emacs-64b469f6ae8173116ec948ac43cd44efe4b5a221.zip | |
Don't infloop in url.el when sending invalid basic auth
* lisp/url/url-http.el (url-http-handle-authentication): Bail out
if the wrong credentials were passed to the server instead of
inflooping (bug#27022).
| -rw-r--r-- | lisp/url/url-http.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 527760118d4..f7f2f3d179d 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el | |||
| @@ -453,6 +453,14 @@ Return the number of characters removed." | |||
| 453 | auth | 453 | auth |
| 454 | (strength 0)) | 454 | (strength 0)) |
| 455 | 455 | ||
| 456 | ;; If we're here, then we got a 40x Unauthorized response from the | ||
| 457 | ;; server. If we already have "Authorization" in the extra | ||
| 458 | ;; headers, then this means that we've already tried sending | ||
| 459 | ;; credentials to the server, and they were wrong, so just give | ||
| 460 | ;; up. | ||
| 461 | (when (assoc "Authorization" url-http-extra-headers) | ||
| 462 | (error "Wrong authorization used for %s" url)) | ||
| 463 | |||
| 456 | ;; find strongest supported auth | 464 | ;; find strongest supported auth |
| 457 | (dolist (this-auth auths) | 465 | (dolist (this-auth auths) |
| 458 | (setq this-auth (url-eat-trailing-space | 466 | (setq this-auth (url-eat-trailing-space |