From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.bugs Subject: bug#24490: 25.1; restclient no longer sends auth header upon redirect Date: Thu, 08 Jul 2021 17:34:19 -0400 Message-ID: References: <87sg0rphvj.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12773"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Alain Picard , 24490@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 08 23:35:13 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 1m1bfs-00036y-Um for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Jul 2021 23:35:12 +0200 Original-Received: from localhost ([::1]:44678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1bfr-0007tZ-Lr for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Jul 2021 17:35:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1bfi-0007tM-SW for bug-gnu-emacs@gnu.org; Thu, 08 Jul 2021 17:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46209) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1bfi-0007US-Le for bug-gnu-emacs@gnu.org; Thu, 08 Jul 2021 17:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1bfi-0007zH-F5 for bug-gnu-emacs@gnu.org; Thu, 08 Jul 2021 17:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Jul 2021 21:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24490 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 24490-submit@debbugs.gnu.org id=B24490.162578007030653 (code B ref 24490); Thu, 08 Jul 2021 21:35:02 +0000 Original-Received: (at 24490) by debbugs.gnu.org; 8 Jul 2021 21:34:30 +0000 Original-Received: from localhost ([127.0.0.1]:57755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1bfC-0007yK-2r for submit@debbugs.gnu.org; Thu, 08 Jul 2021 17:34:30 -0400 Original-Received: from mail-qt1-f179.google.com ([209.85.160.179]:45638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1bf8-0007y4-LX for 24490@debbugs.gnu.org; Thu, 08 Jul 2021 17:34:28 -0400 Original-Received: by mail-qt1-f179.google.com with SMTP id z25so3299888qto.12 for <24490@debbugs.gnu.org>; Thu, 08 Jul 2021 14:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fitzsim-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=0E1BKQM5mFdRaYTH3rRDgm7Mki6GUffZXWQiAn+j0ns=; b=TxH6c9F4PsqzyUueO51KvTGobNqz8hQrKTQn4PRE1ZUR8qo4IpfEcVfVDzJYGp5EEb P7RCzgRiappuZ58nfnilm4MdUfz8UmPr5Y/5PVYWSgxjXMake/UBVd8JSUGInBiMaRpp 5l/nY9B+tWC149jL0kQGT3ZcY37azPnLNNwxSeZ7EFQ73dmskLop9TI2jNWxUCkQn+wB 9R8PDMNnEt1ldv53CC+bEipU33zDaU8cWGtnSpZj5PmitgvuowOG5Q3Bon//XmsXhpZw 6C3yUHDCeclPGM531tzTlooYm1TyAzpAX5eQSBcGvcGvQRgObox/tfhQiGPbYdEtegDn ZyGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=0E1BKQM5mFdRaYTH3rRDgm7Mki6GUffZXWQiAn+j0ns=; b=XqzCYqrwJgjsUlrfAWaPjAXaQfoXQlt9qULUv35bNiPScjwFmcmjW04cMxnCy7PNSN XUfYnG9Uxtz2g3G7idjC3omcPisxg09O2MFpeb9JLQuQzRc6t/rzZSg1bl0R5dybY7dD cQRzKF96m7ejcrahlSR255okQz1cr6oa8Jw3gAZCffRncBJR7GbP+tsUGOkclDJyX7F0 /oBVh+dGdEEJ2ksI/5OC4OEun3UwIDP8Fg+jHzRKVC6I5Z9ltplqYpRPdl36tFKswvAX hOCWycpyAgK/ajj/0STmdSuZib8SI7gds3OKtrZcORm9lhhGzG/wfZ89Gm2CbXEe7e76 rpxQ== X-Gm-Message-State: AOAM531gHy1ITLX/yxGbyHIitAJHjqhbLpD58b6lugaLU8S7ZN2Hj6Du 9Y7JeNmcEuvFHfnQCqQodgls9RhzJl3CqxEb X-Google-Smtp-Source: ABdhPJwTqVQOCp4QNdj/WQoOk0YgiJsvRhlbw0Yr9xfhFslf7P/C/vn4jCaLG5jJNmXysiSVy+4urA== X-Received: by 2002:ac8:4a8b:: with SMTP id l11mr20230761qtq.250.1625780060788; Thu, 08 Jul 2021 14:34:20 -0700 (PDT) Original-Received: from localhost.localdomain (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id n191sm1602436qke.10.2021.07.08.14.34.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jul 2021 14:34:20 -0700 (PDT) In-Reply-To: <87sg0rphvj.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 06 Jul 2021 17:44:00 +0200") 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:209712 Archived-At: Lars Ingebrigtsen writes: > Alain Picard writes: > >> Dear Maintainers, >> >> In emacs 25.1, >> the code in url-http.el, line 638, states: >> >> ;; Do not automatically include an authorization header in the >> ;; redirect. If needed it will be regenerated by the relevant >> ;; auth scheme when the new request happens. >> (setq url-http-extra-headers >> (cl-remove "Authorization" >> url-http-extra-headers :key 'car :test 'equal)) >> >> I suspect this automatic regenration does not occur. > > I think this code is basically correct -- if the auth scheme has added > something to url-http-extra-headers, then that has to be removed when > doing the redirect, because otherwise we might be sending the auth to a > completely wrong server, with the security implications of that. > >> Problem: I am using restclient.el, and hitting a server which >> issues a redirect, and I receive a 400 Forbidden response because >> the redirected call does not receive the authentication header >> (I can see this from the log of my server). > > I think this must be a bug in restclient.el -- it should instead use an > auth scheme that re-adds the Authorization header. It looks like restclient.el uses advice to skip url-http-handle-authentication if it (restclient) is in the middle of a request. Alain, to rule out that advice as being responsible, can you do: M-: (ad-deactivate 'url-http-handle-authentication) then try the API call again? Thomas