From 2766282f5a91f4a2739cfc3fce0dee7c7ec9e5cc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 20 Aug 2018 15:11:14 +0200 Subject: import: github: Request API v3 in the 'Accept' header. * guix/import/json.scm (json-fetch): Add #:headers argument and honor it. * guix/import/github.scm (latest-released-version): Pass #:headers to 'json-fetch'. --- guix/import/github.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'guix/import/github.scm') diff --git a/guix/import/github.scm b/guix/import/github.scm index ef226911b9..d7a673e8d6 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Ben Woodcroft -;;; Copyright © 2017 Ludovic Courtès +;;; Copyright © 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -132,7 +132,12 @@ the package e.g. 'bedtools2'. Return #f if there is no releases" (json (json-fetch (if token (string-append api-url "?access_token=" token) - api-url)))) + api-url) + #:headers + ;; Ask for version 3 of the API as suggested at + ;; . + `((Accept . "application/vnd.github.v3+json") + (user-agent . "GNU Guile"))))) (if (eq? json #f) (if token (error "Error downloading release information through the GitHub -- cgit v1.2.3