header: fix runtime error when query_string is null

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-04-14 08:45:34 +03:00
committed by GitHub
parent 1b24b1dcf7
commit 27b7aaa713

View File

@@ -25,6 +25,10 @@ end
-- Function returning GET parameter value (or nil if not set)
function GET(name)
if not mg.request_info.query_string then
return nil
end
return mg.request_info.query_string:match(name.."=([^&]*)")
-- mg.get_var(mg.request_info.query_string, "REQUEST_URI")
end