Skip to content

Commit 0258236

Browse files
fix: minor issues
1 parent 5880134 commit 0258236

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

lua/rest-nvim/client/curl_cli.lua

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ local client = {
1919
request = curl_cli.request,
2020
available = function (req)
2121
local method_ok = vim.list_contains(COMPATIBLE_METHODS, req.method)
22-
local url_ok = req.url:match("^https?://")
23-
return method_ok and url_ok
22+
local scheme = req.url:match("^(.+)://")
23+
local scheme_ok = (not scheme) or scheme == "http" or scheme == "https"
24+
return method_ok and scheme_ok
2425
end
2526
}
2627

lua/rest-nvim/parser/dotenv.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local function value_tostring(value)
1818
value = {
1919
value,
2020
function (v)
21-
return v == vim.NIL or vim.tbl_contains({ "nil", "number", "string", "boolean" }, value)
21+
return v == vim.NIL or vim.tbl_contains({ "nil", "number", "string", "boolean" }, type(value))
2222
end,
2323
"vim.NIL|nil|bumber|string|boolean"
2424
}

spec/client/curl/cli_spec.lua

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ local Context = require("rest-nvim.context").Context
77
local curl = require("rest-nvim.client.curl.cli")
88
local builder = curl.builder
99
local parser = curl.parser
10-
local nio = require("nio")
1110

1211
local STAT_FORMAT = builder.STAT_ARGS[2]
1312

spec/examples/variables/in_place_variables.http

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@myhost = example.org
33

44
# this is not a in-place variable
5-
# @myhost = example.org
5+
# @myhost = example.net
66

77
###
88
GET {{myhost}}/users
@@ -19,3 +19,4 @@ GET {{myhost}}/stats
1919

2020
###
2121
# check `spec/examples/script/pre_request_script.http` for variable local to each requests
22+
@myhost=bruh

0 commit comments

Comments
 (0)