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 if data ~= nil then
local flags = "" local flags = ""
for k, v in pairs(data) do 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 end
curl = io.popen(string.format( 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)) self.CURL_FLAGS, self.COOKIE_JAR, self.COOKIE_JAR, flags, self.HOST, api))
else else
curl = io.popen(string.format( 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)) self.CURL_FLAGS, self.COOKIE_JAR, self.COOKIE_JAR, self.HOST, api))
end end
responce = curl:read("a") responce = curl:read("a")