Fixing redirection issue after changing interface (#4022)

Simplifies interface switch send redirect code

Addresses https://github.com/ntop/ntopng/pull/4022
This commit is contained in:
andpp 2020-06-08 01:08:38 -07:00 committed by Simone Mainardi
parent 80e5400c36
commit 87d77d12d6
3 changed files with 11 additions and 5 deletions

View file

@ -779,8 +779,13 @@ for round = 1, 2 do
print("<a class=\"dropdown-item active\" href=\"#\">")
else
-- NOTE: the actual interface switching is performed in C in LuaEngine::handle_script_request
local action_url = ntop.getHttpPrefix() .. '/' ..url_query
local action_url = ""
if(is_system_interface) then
action_url = ntop.getHttpPrefix() .. '/' .. url_query
else
action_url = url_query
end
print[[<form id="switch_interface_form_]] print(tostring(k)) print([[" method="post" action="]].. action_url ..[[]]) print[[">]]
print[[<input name="switch_interface" type="hidden" value="1" />]]
print[[<input name="csrf" type="hidden" value="]] print(ntop.getRandomCSRFValue()) print[[" />]]