aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/managers/github/client.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-10-14 16:38:32 +0200
committerGitHub <noreply@github.com>2022-10-14 16:38:32 +0200
commit95ca710e47fdd65407d4a776a966963e455b56c7 (patch)
treef68f725e88803cbcd22c7ac73cce532efe381a34 /lua/mason-core/managers/github/client.lua
parentchore: update generated code (#551) (diff)
downloadmason-95ca710e47fdd65407d4a776a966963e455b56c7.tar
mason-95ca710e47fdd65407d4a776a966963e455b56c7.tar.gz
mason-95ca710e47fdd65407d4a776a966963e455b56c7.tar.bz2
mason-95ca710e47fdd65407d4a776a966963e455b56c7.tar.lz
mason-95ca710e47fdd65407d4a776a966963e455b56c7.tar.xz
mason-95ca710e47fdd65407d4a776a966963e455b56c7.tar.zst
mason-95ca710e47fdd65407d4a776a966963e455b56c7.zip
feat(fetch): add Accept headers where appropriate (#554)
Diffstat (limited to 'lua/mason-core/managers/github/client.lua')
-rw-r--r--lua/mason-core/managers/github/client.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/mason-core/managers/github/client.lua b/lua/mason-core/managers/github/client.lua
index e375c45a..9583ab6d 100644
--- a/lua/mason-core/managers/github/client.lua
+++ b/lua/mason-core/managers/github/client.lua
@@ -25,7 +25,11 @@ local function gh_api_call(path, opts)
.gh({ "api", path, env = { CLICOLOR_FORCE = 0 } })
:map(_.prop "stdout")
:recover_catching(function()
- return fetch(("https://api.github.com/%s"):format(path)):get_or_throw()
+ return fetch(("https://api.github.com/%s"):format(path), {
+ headers = {
+ Accept = "application/vnd.github.v3+json; q=1.0, application/json; q=0.8",
+ },
+ }):get_or_throw()
end)
:map_catching(vim.json.decode)
end