From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#50511: 27.2; url-http-handle-authentication should not raise error Date: Fri, 10 Sep 2021 18:14:54 +0200 Message-ID: <87y284l85d.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36236"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen To: 50511@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 10 18:16:32 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOjCa-0009Bs-Di for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Sep 2021 18:16:32 +0200 Original-Received: from localhost ([::1]:34544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOjCZ-0001V0-7Q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Sep 2021 12:16:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOjC6-0001Ud-CA for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 12:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOjC6-0000aR-3p for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 12:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mOjC5-0005PJ-Ne for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 12:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Sep 2021 16:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50511 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163129050920700 (code B ref -1); Fri, 10 Sep 2021 16:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Sep 2021 16:15:09 +0000 Original-Received: from localhost ([127.0.0.1]:39030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOjBE-0005No-P6 for submit@debbugs.gnu.org; Fri, 10 Sep 2021 12:15:08 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:37872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOjBD-0005Nh-1D for submit@debbugs.gnu.org; Fri, 10 Sep 2021 12:15:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOjBC-0001Jn-RX for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 12:15:06 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:39862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOjBA-00085x-Lw for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 12:15:06 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id D9BE6163FC; Fri, 10 Sep 2021 18:14:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-type:content-type:mime-version:message-id:date:date :subject:subject:from:from:received:received; s=sel2011a; t= 1631290496; bh=RO/EyGPe30nqlhIW/AKyqhkgOpRakTFXt3Rwzh/YKM8=; b=3 p0YNJ9qV0p2fDLWy4QSupt+146eHrpAyJqcdpGwWXsDOR40ZnV/X4NF32T0Fqa/J /N91dAShBfUPbK8GowmXdfM5OhRb79v/qWat6a19qyq5F1fG7S4fMxK5pdktdPO+ cJTdY1HhjtpgPAQOgjme7ExIaZDP61Kp6onalOz64M= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id s6dwBFQxLMGP; Fri, 10 Sep 2021 18:14:56 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id AD1E81647F; Fri, 10 Sep 2021 18:14:56 +0200 (CEST) Received-SPF: none client-ip=212.243.197.30; envelope-from=jonas@bernoul.li; helo=mail.hostpark.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214026 Archived-At: 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