aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorFederico Beffa <beffa@fbengineering.ch>2017-02-05 14:42:10 +0100
committerFederico Beffa <beffa@fbengineering.ch>2017-02-09 19:36:04 +0100
commit81e0bc1834490a1a8092c75a0733b15c2b407285 (patch)
treec3d49c329e53dec44fd5e6fb54c2fc84ef4add95 /guix
parent4554813936a00ce33b4c80df4dc9e1092bf79470 (diff)
downloadgnu-guix-81e0bc1834490a1a8092c75a0733b15c2b407285.tar
gnu-guix-81e0bc1834490a1a8092c75a0733b15c2b407285.tar.gz
import: json: Explicitly ask for JSON data.
* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/json.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/guix/import/json.scm b/guix/import/json.scm
index 5940f5e48f..c76bc9313c 100644
--- a/guix/import/json.scm
+++ b/guix/import/json.scm
@@ -29,7 +29,8 @@
(guard (c ((and (http-get-error? c)
(= 404 (http-get-error-code c)))
#f)) ;"expected" if package is unknown
- (let* ((port (http-fetch url))
+ (let* ((port (http-fetch url #:headers '((user-agent . "GNU Guile")
+ (Accept . "application/json"))))
(result (hash-table->alist (json->scm port))))
(close-port port)
result)))