Browse Source

import: json: Explicitly ask for JSON data.

* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
wip-git-https
Federico Beffa 5 years ago
parent
commit
81e0bc1834
No known key found for this signature in database GPG Key ID: 58936E0E2F1B5A4C
  1. 3
      guix/import/json.scm

3
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)))
Loading…
Cancel
Save