mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-08 14:50:54 +00:00
Fixes nEDGE captive portal ssl redirection
This commit is contained in:
parent
fa6d428b13
commit
aa11e532e1
1 changed files with 11 additions and 8 deletions
|
|
@ -611,16 +611,19 @@ static int handle_lua_request(struct mg_connection *conn) {
|
|||
redirect_to_please_wait(conn, request_info);
|
||||
} else
|
||||
#endif
|
||||
if(ntop->get_HTTPserver()->is_ssl_enabled()
|
||||
&& (!request_info->is_ssl)
|
||||
&& isCaptiveURL(request_info->uri)
|
||||
&& (!strstr(referer, HOTSPOT_DETECT_LUA_URL))
|
||||
&& (!strstr(referer, CAPTIVE_PORTAL_URL))
|
||||
// && ((mg_get_header(conn, "Host") == NULL) || (mg_get_header(conn, "Host")[0] == '\0'))
|
||||
) {
|
||||
#ifndef HAVE_OLD_NEDGE
|
||||
if(ntop->get_HTTPserver()->is_ssl_enabled()
|
||||
&& (!request_info->is_ssl)
|
||||
&& isCaptiveURL(request_info->uri)
|
||||
&& (!strstr(referer, HOTSPOT_DETECT_LUA_URL))
|
||||
&& (!strstr(referer, CAPTIVE_PORTAL_URL))
|
||||
// && ((mg_get_header(conn, "Host") == NULL) || (mg_get_header(conn, "Host")[0] == '\0'))
|
||||
) {
|
||||
redirect_to_ssl(conn, request_info);
|
||||
return(1);
|
||||
} else if(!strcmp(request_info->uri, HOTSPOT_DETECT_URL)) {
|
||||
} else
|
||||
#endif
|
||||
if(!strcmp(request_info->uri, HOTSPOT_DETECT_URL)) {
|
||||
mg_printf(conn, "HTTP/1.1 302 Found\r\n"
|
||||
"Expires: 0\r\n"
|
||||
"Cache-Control: no-store, no-cache, must-revalidate\t\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue