Subject: Re: bug#79186: 31.0.50; Make dynamic binding of url-max-redirections work

From: Robert Pluim <[email-masked]>
Date: Thu, 07 Aug 2025 10:24:33 +0200

>>>>> On Wed, 06 Aug 2025 22:28:18 +0200, "Peder O. Klingenberg" <[email-masked]> said:

    Peder> Following on from bug#61916, there was one variable I missed that should
    Peder> also have a faux-dynamic binding: url-max-redirections.

    Peder> To demonstrate:

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

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

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

    Peder> With the attached patch it stops after the first redirection.

I tried to apply this, but it failed because you quoted `like this`,
which our commit hooks reject. Best is to quote 'like this' in commit
messages and resubmit (this also gives you the chance to add
(Bug#79186) somewhere in the commit message 😀).

Robert
--