Changes for page 2 Script

Last modified by Devin Chen on 2026/03/10 10:53

From version 19.1
edited by Devin Chen
on 2026/03/05 16:05
Change comment: There is no comment for this version
To version 21.1
edited by Devin Chen
on 2026/03/10 10:53
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -2118,14 +2118,12 @@
2118 2118   local max_redirects = 0 -- Number of redirects to follow (set to 0 for none)
2119 2119   local current_url = req_url
2120 2120  
2121 - -- Loop to handle potential redirects (currently limited to 0 redirects)
2122 - -- for redirect_count = 0, max_redirects do
2123 - local response_body = {}
2124 - local res, code, response_headers = https.request{
2121 + local response_body = {}
2122 + local res, code, response_headers = https.request{
2125 2125   url = current_url,
2126 2126   method = "POST",
2127 2127   headers = {
2128 - ["Content-Type"] = "application/json", -- Must be text/plain to bypass CORS preflight
2126 + ["Content-Type"] = "application/json",
2129 2129   ["Content-Length"] = #request_body
2130 2130   },
2131 2131   source = ltn12.source.string(request_body),