[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: import: json: Explicitly ask for JSON data.
From: |
Federico Beffa |
Subject: |
01/03: import: json: Explicitly ask for JSON data. |
Date: |
Thu, 9 Feb 2017 13:36:53 -0500 (EST) |
beffa pushed a commit to branch master
in repository guix.
commit 81e0bc1834490a1a8092c75a0733b15c2b407285
Author: Federico Beffa <address@hidden>
Date: Sun Feb 5 14:42:10 2017 +0100
import: json: Explicitly ask for JSON data.
* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
---
guix/import/json.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/guix/import/json.scm b/guix/import/json.scm
index 5940f5e..c76bc93 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)))