Use single quotes in curl command line

This commit is contained in:
Shy 2024-08-28 13:38:27 +02:00
parent 6433e6f14e
commit eb2f1410c8

6
c4mate
View file

@ -52,14 +52,14 @@ function MatePad:fetch(api, data)
if data ~= nil then
local flags = ""
for k, v in pairs(data) do
flags = string.format("%s --data-urlencode \"%s=%s\"", flags, k, v)
flags = string.format("%s --data-urlencode '%s=%s'", flags, k, v)
end
curl = io.popen(string.format(
"curl %s --cookie \"%s\" --cookie-jar \"%s\" %s \"%s/%s\"",
"curl %s --cookie '%s' --cookie-jar '%s' %s '%s/%s'",
self.CURL_FLAGS, self.COOKIE_JAR, self.COOKIE_JAR, flags, self.HOST, api))
else
curl = io.popen(string.format(
"curl %s --cookie \"%s\" --cookie-jar \"%s\" \"%s/%s\"",
"curl %s --cookie '%s' --cookie-jar '%s' '%s/%s'",
self.CURL_FLAGS, self.COOKIE_JAR, self.COOKIE_JAR, self.HOST, api))
end
responce = curl:read("a")