From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctf4D-0000bg-Dy for guix-patches@gnu.org; Thu, 30 Mar 2017 14:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctf4A-0006aV-9E for guix-patches@gnu.org; Thu, 30 Mar 2017 14:45:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:54991) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ctf4A-0006aQ-65 for guix-patches@gnu.org; Thu, 30 Mar 2017 14:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ctf4A-0002HM-0W for guix-patches@gnu.org; Thu, 30 Mar 2017 14:45:02 -0400 Subject: bug#26314: [PATCH] substitute: Send =?UTF-8?Q?=E2=80=98User-Agent=E2=80=99?= header. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctf36-0000Jk-6P for guix-patches@gnu.org; Thu, 30 Mar 2017 14:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctf32-00066j-Ro for guix-patches@gnu.org; Thu, 30 Mar 2017 14:43:56 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:58782) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ctf32-00066S-Lk for guix-patches@gnu.org; Thu, 30 Mar 2017 14:43:52 -0400 Received: from mfilter13-d.gandi.net (mfilter13-d.gandi.net [217.70.178.141]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id E4AF8172095 for ; Thu, 30 Mar 2017 20:43:49 +0200 (CEST) Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter13-d.gandi.net (mfilter13-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id EHpWkvHdAL2t for ; Thu, 30 Mar 2017 20:43:48 +0200 (CEST) Received: from v5.tobias.gr (83.166-241-81.adsl-dyn.isp.belgacom.be [81.241.166.83]) (Authenticated sender: me@tobias.gr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 4E75017209A for ; Thu, 30 Mar 2017 20:43:47 +0200 (CEST) From: Tobias Geerinckx-Rice Date: Thu, 30 Mar 2017 20:44:39 +0200 Message-Id: <20170330184439.8896-1-me@tobias.gr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26314@debbugs.gnu.org * guix/scripts/substitute.scm (narinfo-request): Pass ‘User-Agent’ #:headers to ‘build-request’. --- Guix, This makes the User-Agent sent to substitute servers consistent. Currently, ‘http-fetch’ (used to download .nars) sets it to ‘GNU Guile’, while http-multiple-get (used to download .narinfos) leaves it empty. (This brings the number of scattered '"GNU Guile"' user-agent settings in Guix to 5, but moving it to %guix-default-http-user-agent does not strike me as a meaningful improvement.) Kind regards, T G-R guix/scripts/substitute.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index faeb01912..d3bccf4dd 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -520,8 +520,9 @@ indicates that PATH is unavailable at CACHE-URL." (define (narinfo-request cache-url path) "Return an HTTP request for the narinfo of PATH at CACHE-URL." (let ((url (string-append cache-url "/" (store-path-hash-part path) - ".narinfo"))) - (build-request (string->uri url) #:method 'GET))) + ".narinfo")) + (headers '((User-Agent . "GNU Guile")))) + (build-request (string->uri url) #:method 'GET #:headers headers))) (define* (http-multiple-get base-uri proc seed requests #:key port (verify-certificate? #t)) -- 2.37.4