mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
fix(vim.net): unreliable integration tests #39594
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user