3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

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

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