With Codestral and maybe other backends the same headers are passed to Get for every request. Without this change for each request an additional Content-Type header is added. Codestral fails when multiple Content-Type headers are present.
For example when using Codestral I generated the folloing curl args
{\n code = vim.NIL,\n message = "Input should be a valid dictionary or object to extract fields from",\n object = "error",\n param = vim.NIL,\n type = "invalid_request_error"\n}
This commit makes a shallow copy of the headers before adding additional headers
With Codestral and maybe other backends the same headers are passed to Get for every request. Without this change for each request an additional Content-Type header is added. Codestral fails when multiple Content-Type headers are present.
For example when using Codestral I generated the folloing curl args
And I get the response:
This commit makes a shallow copy of the headers before adding additional headers