GNU bug report logs - #79186
31.0.50; Make dynamic binding of url-max-redirections work

Previous Next

Package: emacs;

Reported by: "Peder O. Klingenberg" <peder <at> klingenberg.no>

Date: Wed, 6 Aug 2025 20:51:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Peder O. Klingenberg" <peder <at> klingenberg.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Make dynamic binding of url-max-redirections work
Date: Wed, 06 Aug 2025 22:28:18 +0200
[Message part 1 (text/plain, inline)]
Following on from bug#61916, there was one variable I missed that should
also have a faux-dynamic binding: url-max-redirections.

To demonstrate:

(setq url-debug t) ;; and follow the results in the *URL-DEBUG* buffer
(setq url-max-redirections 30) ;; the default

(let ((url-max-redirections 0))
  (url-retrieve "http://httpbin.org/redirect/5"
    #'(lambda (&rest _args)
        (message "done"))))

This will cause 5 redirections to be followed by url-http.el, because it
still sees url-max-redirections as 30.

With the attached patch it stops after the first redirection.

-- 
...Peder...

[0001-Emulate-dynamic-binding-of-url-max-redirections.patch (text/x-diff, attachment)]

This bug report was last modified 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.