fix(vim.net): unreliable integration tests #39594

This commit is contained in:
Ellison
2026-05-05 17:26:59 -03:00
committed by GitHub
parent 97ef9f74b2
commit b1ebf45a6d
2 changed files with 169 additions and 146 deletions

View File

@@ -10,7 +10,7 @@ local http_methods = {
}
---@alias vim.net.request.ResponseFunc fun(err: string?, response: vim.net.request.Response?)
---@alias vim.net.HttpMethod string "GET" | "POST" | "PUT" | "PACH" | "HEAD"| "DELETE
---@alias vim.net.HttpMethod string "GET" | "POST" | "PUT" | "PATCH" | "HEAD" | "DELETE"
---@class vim.net.request.Opts
---@inlinedoc
@@ -98,8 +98,8 @@ function M.request(method, url, opts, on_response)
opts = opts or {}
vim.validate('method', method, function(m)
return http_methods[m] == true, ('invalid HTTP method: %s'):format(m)
end)
return http_methods[m] == true
end, 'method should be one of GET, POST, PUT, PATCH, HEAD, DELETE')
vim.validate('url', url, 'string')
vim.validate('opts', opts, 'table', true)
vim.validate('opts.headers', opts.headers, 'table', true)