~ruther/guix-local

81e0bc1834490a1a8092c75a0733b15c2b407285 — Federico Beffa 9 years ago 4554813
import: json: Explicitly ask for JSON data.

* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
1 files changed, 2 insertions(+), 1 deletions(-)

M guix/import/json.scm
M guix/import/json.scm => guix/import/json.scm +2 -1
@@ 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)))