Skip to content

Commit

Permalink
feat: add custom additional curl opts
Browse files Browse the repository at this point in the history
This fixes #29.
  • Loading branch information
gorillamoe committed Jul 4, 2024
1 parent 9ebea0d commit 6d93f19
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ require('lazy').setup({
done = ""
},
lualine = "🐼",
}
},
-- additional cURL options
-- e.g. { "--insecure", "-A", "Mozilla/5.0" }
additional_curl_options = {},
})
end
},
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# kulala.nvim <small>1.4.0</small>
# kulala.nvim <small>1.5.0</small>

> A minimal 🤏 HTTP-client 🐼 interface 🖥️ for Neovim ❤️.
Expand Down
5 changes: 4 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ require('lazy').setup({
done = ""
},
lualine = "🐼",
}
},
-- additional cURL options
-- e.g. { "--insecure", "-A", "Mozilla/5.0" }
additional_curl_options = {},
})
end
},
Expand Down
5 changes: 4 additions & 1 deletion lua/kulala/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ KULALA_CONFIG = KULALA_CONFIG or {
done = ""
},
lualine = "🐼",
}
},
-- additional cURL options
-- see: https://curl.se/docs/manpage.html
additional_curl_options = {},
}

local M = {}
Expand Down
2 changes: 1 addition & 1 deletion lua/kulala/globals/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local FS = require("kulala.utils.fs")

local M = {}

M.VERSION = "1.4.0"
M.VERSION = "1.5.0"
M.UI_ID = "kulala://ui"
M.HEADERS_FILE = FS.get_plugin_tmp_dir() .. "/headers.txt"
M.BODY_FILE = FS.get_plugin_tmp_dir() .. "/body.txt"
Expand Down
3 changes: 3 additions & 0 deletions lua/kulala/parser/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ function M.parse()
end
table.insert(res.cmd, "-A")
table.insert(res.cmd, "kulala.nvim/".. GLOBALS.VERSION)
for _, additional_curl_option in pairs(CFG.additional_curl_options) do
table.insert(res.cmd, additional_curl_option)
end
table.insert(res.cmd, res.request.url)
if res.headers['accept'] == "application/json" then
res.ft = "json"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kulala.nvim",
"version": "1.4.0",
"version": "1.5.0",
"scripts": {
"docs": "docsify serve docs"
},
Expand Down

0 comments on commit 6d93f19

Please sign in to comment.