1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

tests: Pass ‘User-Agent’ header when downloading from www.gnu.org.

This test had been failing for a few months in part due to this change at
www.gnu.org.

* tests/derivations.scm ("fixed-output derivation, network access, external host"):
Pass #:headers to ‘http-get’.

Change-Id: Ife54e65b2665704af433df669df0d4010b49884c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7470
This commit is contained in:
Ludovic Courtès
2026-03-25 19:03:38 +01:00
parent 425aa1bf7c
commit 0a8acc0059

View File

@@ -584,8 +584,11 @@
(set! (@ (guile) set-port-encoding!) (const #t))
(let-values (((response body)
;; Note: www.gnu.org returns 403 when
;; 'User-Agent' is missing.
(http-get "http://www.gnu.org/licenses/gpl-3.0.txt"
#:decode-body? #f)))
#:decode-body? #f
#:headers '((user-agent . "GNU Guile")))))
(call-with-output-file %output
(lambda (port)
(put-bytevector port body)))))