import: json: Explicitly ask for JSON data.

* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
This commit is contained in:
Federico Beffa 2017-02-05 14:42:10 +01:00
parent 4554813936
commit 81e0bc1834
No known key found for this signature in database
GPG Key ID: 58936E0E2F1B5A4C
1 changed files with 2 additions and 1 deletions

View File

@ -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)))