mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 19:03:56 +08:00
🌈 Sync 2026-09-29 11:54:37
This commit is contained in:
1 parent
eb664281f6
commit
7eac2a209f
44 files changed
+1356
-869
No files matched your search
@@ -1779,6 +1779,9 @@ local function curl(url, file, ua, mode)
|
||||
ua = (ua == "passwall") and ("passwall/" .. api.get_version()) or ua
|
||||
curl_args[#curl_args + 1] = '--user-agent "' .. ua .. '"'
|
||||
|
||||
local cookie_file = "/tmp/cookie_" .. api.gen_random_char(5)
|
||||
curl_args[#curl_args + 1] = '-c "' .. cookie_file .. '" -b "' .. cookie_file .. '"'
|
||||
|
||||
local return_code, result
|
||||
if mode == "direct" then
|
||||
return_code, result = api.curl_base(url, file, curl_args)
|
||||
@@ -1801,6 +1804,8 @@ local function curl(url, file, ua, mode)
|
||||
header_str = header_str:gsub("\r", "")
|
||||
end
|
||||
|
||||
luci.sys.call('rm -f "%s"' % cookie_file)
|
||||
|
||||
return return_code, http_code, header_str
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user