From 2f5d53540faf2b040ea3c473e7aa86865a0773c7 Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 13 Sep 2021 16:12:58 +0200 Subject: [PATCH] [fix] redirect with uri --- helpers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.lua b/helpers.lua index 323804a..a060291 100644 --- a/helpers.lua +++ b/helpers.lua @@ -1061,7 +1061,7 @@ function redirect(url) -- And if `uri_args.r` contains line break, someone is probably trying to -- pass some additional headers local domain = url:match("^https?://([%w%.]*)/?") - if string.match(url, "(.*)\n") or not is_in_table(conf["domains"], domain) then + if string.match(url, "(.*)\n") or (domain ~= nil and not is_in_table(conf["domains"], domain)) then logger.debug("Unauthorized redirection to "..url) flash("fail", t("redirection_error_invalid_url")) url = conf.portal_url