unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50511: 27.2; url-http-handle-authentication should not raise error
@ 2021-09-10 16:14 Jonas Bernoulli
  2021-09-11 13:05 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Jonas Bernoulli @ 2021-09-10 16:14 UTC (permalink / raw)
  To: 50511; +Cc: Lars Ingebrigtsen

Since [1: 64b469f6ae] url-http-handle-authentication raises an error
when it detects that we already tried to make an authenticated request.

1: 2019-07-26 64b469f6ae8173116ec948ac43cd44efe4b5a221
   Don't infloop in url.el when sending invalid basic auth

Instead of signaling an error using `error', it should simply return t
to indicate that no further requests should be made and the response
data (in this case error data) should be passed to the handler, i.e. to
indicate that the request "successfully failed".  Then the error handler
can inspect the response and decide how to react.

This is how it is done for all other https response codes, including all
other error codes.  This approach also solves the infloop issue but also
makes it possible to use an error handler as intended.

     Jonas





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#50511: 27.2; url-http-handle-authentication should not raise error
  2021-09-10 16:14 bug#50511: 27.2; url-http-handle-authentication should not raise error Jonas Bernoulli
@ 2021-09-11 13:05 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-11 13:05 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: 50511

Jonas Bernoulli <jonas@bernoul.li> writes:

> Since [1: 64b469f6ae] url-http-handle-authentication raises an error
> when it detects that we already tried to make an authenticated request.
>
> 1: 2019-07-26 64b469f6ae8173116ec948ac43cd44efe4b5a221
>    Don't infloop in url.el when sending invalid basic auth
>
> Instead of signaling an error using `error', it should simply return t
> to indicate that no further requests should be made and the response
> data (in this case error data) should be passed to the handler, i.e. to
> indicate that the request "successfully failed".  Then the error handler
> can inspect the response and decide how to react.
>
> This is how it is done for all other https response codes, including all
> other error codes.  This approach also solves the infloop issue but also
> makes it possible to use an error handler as intended.

Makes sense.  Can you propose a patch for this (since you can reproduce
the problem and verify that the patch fixes it)?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-11 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 16:14 bug#50511: 27.2; url-http-handle-authentication should not raise error Jonas Bernoulli
2021-09-11 13:05 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).