openresty-config/lua/rewrite-invidious/check-backend.lua
2025-02-11 20:13:49 -03:00

15 lines
311 B
Lua

local _M = {}
function _M.check_backend_args()
local args = ngx.req.get_uri_args()
for key, val in pairs(args) do
if key == "backend" then
val = tonumber(val)
if val == nil then
ngx.say("error: Wrong backend. Backends only supports numbers!")
end
end
end
end
return _M