Closed Mythos-404 closed 1 year ago
A potential shortcoming of your approach is that it does not address all proxy functionality provided by curl (e.g. username or password of the proxy). To also account for future use cases, an alternative would be to simply add a default_args
table instead, allowing the user to add arbitrary flags to the curl command.
Thanks for the review. This default_args how do I achieve it
This default_args how do I achieve it
Somethink like this:
local args = vim.tbl_extend("error", self.config.user_args, {
"--fail-with-body",
"--retry", self.config.retry,
"--max-time", self.config.timeout,
"--retry-max-time", self.config.timeout,
"--request", request,
"--header", "accept: application/json",
tostring(self._url / path)
})
Then users can add user_args = {"-x", "https://whatever.com:1234"}
to their config and be done with it. I think that would be the way to go.
A proxy that uses the HTTP protocol