aboutsummaryrefslogtreecommitdiff
path: root/guix/import/github.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-13 18:22:53 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-13 18:24:19 +0100
commit608a50b66c73d5bdfd224195b839e01b781c354c (patch)
treed20e2e622bfe7db344938ce051f6ef3894900d19 /guix/import/github.scm
parent4cd5ec801bb6c82cc1df2c4ac419d89614aa5d1b (diff)
downloadgnu-guix-608a50b66c73d5bdfd224195b839e01b781c354c.tar
gnu-guix-608a50b66c73d5bdfd224195b839e01b781c354c.tar.gz
http-client: Provide 'User-Agent' header by default.
* guix/http-client.scm (http-fetch): Add #:headers parameter and honor it. Rename 'auth-header' to 'headers'. * guix/import/github.scm (json-fetch*): Add comment about required User-Agent.
Diffstat (limited to 'guix/import/github.scm')
-rw-r--r--guix/import/github.scm1
1 files changed, 1 insertions, 0 deletions
diff --git a/guix/import/github.scm b/guix/import/github.scm
index a41511aff6..df5a6b0e08 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -36,6 +36,7 @@
(guard (c ((and (http-get-error? c)
(= 404 (http-get-error-code c)))
#f)) ;"expected" if package is unknown
+ ;; Note: github.com returns 403 if we omit a 'User-Agent' header.
(let* ((port (http-fetch url))
(result (json->scm port)))
(close-port port)