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: Wed, 14 Jul 2021 13:47:36 -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="1247"; 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 Wed Jul 14 19:51: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 1m3j2O-00009B-Cj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Jul 2021 19:51:12 +0200 Original-Received: from localhost ([::1]:41992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3j2N-0000Dh-AE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Jul 2021 13:51:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3izK-000218-G5 for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2021 13:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3izK-0004m7-7V for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2021 13:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3izK-0007Ik-7S for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2021 13:48: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: Wed, 14 Jul 2021 17:48: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.162628486528024 (code B ref 24490); Wed, 14 Jul 2021 17:48:02 +0000 Original-Received: (at 24490) by debbugs.gnu.org; 14 Jul 2021 17:47:45 +0000 Original-Received: from localhost ([127.0.0.1]:45893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3iz3-0007Hw-E2 for submit@debbugs.gnu.org; Wed, 14 Jul 2021 13:47:45 -0400 Original-Received: from mail-qk1-f169.google.com ([209.85.222.169]:43763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3iz2-0007Hk-3h for 24490@debbugs.gnu.org; Wed, 14 Jul 2021 13:47:44 -0400 Original-Received: by mail-qk1-f169.google.com with SMTP id m3so2407047qkm.10 for <24490@debbugs.gnu.org>; Wed, 14 Jul 2021 10:47:44 -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=iepMb502Ghy17mVzwJUQtqmNMcYk2Df7cKysjzky3rg=; b=qxfHeJmlJvxLI95Fyoe3SKmy/pro1Nrqc1KTsGZ4fstBC1pZp8uoprNicSshI13kom dQRIKSkXDgTiC141Ux9t1UqwmAnfCLFYy3XUnIw5VjdRYHSgKlcTbdWsaMqvBNdYqNO7 Yq0yyf6kVesF2RgCEd7ZY0MoVGSTFIwiue0S0zalI3dtUvXIq0Itn973yjF3XMw2dQh0 O2uoK+9S3zuw5jUDeBTvx/l1RzdQ5XYasj9ZAskk2ReXwVmshdyczl+n25/ylBhUyJRi 8EWo/UMWaMLvSNi5nFv9xOFjPNzPTtbfpP0lOR8XMdpL0aeUQovjVsnYE4p++PPLEko1 R8Cg== 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=iepMb502Ghy17mVzwJUQtqmNMcYk2Df7cKysjzky3rg=; b=QWGalX+QEZl80Ys09zCCyy/34cNWZOcasyWv5fHk7k0gUbkMV2VhDTAJ6Ab2UESfmU S7QqvZRQv7GCslAh8Z9DgC9FAVbDThLkusxhZBtKg/3yUHz+u0kW1pKdRkQjByXoBCY0 estDnhfv84yu7jDfgkEnKVbBgjDSxw9SvGcOSIMPW26hDffj7bhlvRa/xc30mHjk7vbp pbTrZ16ZNOXl1/r8Dd9monjCEUHGMHDrzUv567YtxYmBunmgflm4yqqvUVMF8LEhqHLg pbChluPORydwl+AcJSRZD14pXSpODxRrraS91QcRfsQjjpobvGMNAFOT9Dp6f1EHgWfi qptg== X-Gm-Message-State: AOAM531W/AZhhtpaqqNp1lo9qgpUvi0uZU4CBd9mlSU7UGwiLHEVv4Mt cXr31Ttj1mWr2FiqI2y+0so9tLFhql12oj6MdDs= X-Google-Smtp-Source: ABdhPJxCLbgRwfSsJKGZatqTVjVj0bsWuD+hSyaglxbjw0Vzs0i56DiiALCYY02PJSFzmqsu4JBSTg== X-Received: by 2002:a05:620a:130e:: with SMTP id o14mr2593326qkj.254.1626284858213; Wed, 14 Jul 2021 10:47:38 -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 s81sm1303802qka.82.2021.07.14.10.47.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 10:47:37 -0700 (PDT) In-Reply-To: (Thomas Fitzsimmons's message of "Thu, 08 Jul 2021 17:34:19 -0400") 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:209968 Archived-At: Thomas Fitzsimmons writes: > 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? The email to "alain@gocatch.com" bounced, so I think we should probably close this bug report. Thomas