mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
http-client: Provide 'User-Agent' header by default.
* guix/http-client.scm (http-fetch): Add #:headers parameter and honor it. Rename 'auth-header' to 'headers'. * guix/import/github.scm (json-fetch*): Add comment about required User-Agent.
This commit is contained in:
parent
4cd5ec801b
commit
608a50b66c
2 changed files with 15 additions and 12 deletions
|
@ -36,6 +36,7 @@
|
|||
(guard (c ((and (http-get-error? c)
|
||||
(= 404 (http-get-error-code c)))
|
||||
#f)) ;"expected" if package is unknown
|
||||
;; Note: github.com returns 403 if we omit a 'User-Agent' header.
|
||||
(let* ((port (http-fetch url))
|
||||
(result (json->scm port)))
|
||||
(close-port port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue