emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#26314: closed ([PATCH] substitute: Send ‘User-Agen


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#26314: closed ([PATCH] substitute: Send ‘User-Agent’ header.)
Date: Fri, 31 Mar 2017 13:42:02 +0000

Your message dated Fri, 31 Mar 2017 15:42:53 +0200
with message-id <address@hidden>
and subject line Re: bug#26314: [PATCH] substitute: Send ‘User-Agent’ header.
has caused the debbugs.gnu.org bug report #26314,
regarding [PATCH] substitute: Send ‘User-Agent’ header.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
26314: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26314
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] substitute: Send ‘User-Agent’ header. Date: Thu, 30 Mar 2017 20:44:39 +0200
* 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




--- End Message ---
--- Begin Message --- Subject: Re: bug#26314: [PATCH] substitute: Send ‘User-Agent’ header. Date: Fri, 31 Mar 2017 15:42:53 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
Ludo',

On 31/03/17 10:12, Ludovic Courtès wrote:
> Did the lack of ‘User-Agent’ cause you any problems?

I recently got stuck behind an alt-right proxy that didn't seem to like
it, and had to hack a tunnel through it. I hope such things are rare.

> Go for it!

Pushed as f264e838c0f8b63e93cd7b8a9d5d8e2208d82467.

Thanks!

T G-R

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]