Skip to content

Commit 17984d0

Browse files
committed
fix: use proper headers for GitHub models API call
Previously, headers were hardcoded in the get_models function which made the code less flexible. This change passes headers as a parameter, allowing for proper header configuration when making API calls to the GitHub models endpoint.
1 parent 9d8bc8a commit 17984d0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lua/CopilotChat/config/providers.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,9 @@ M.github_models = {
236236
return get_github_token(), nil
237237
end,
238238

239-
get_models = function()
239+
get_models = function(headers)
240240
local response = utils.curl_post('https://api.catalog.azureml.ms/asset-gallery/v1.0/models', {
241-
headers = {
242-
['content-type'] = 'application/json',
243-
},
241+
headers = headers,
244242
body = [[
245243
{
246244
"filters": [

0 commit comments

Comments
 (0)