Tell browser to unset HSTS policy to make non-SSL URL work

This commit is contained in:
iliajie
2022-09-12 14:52:03 +03:00
parent 6bd63a8a14
commit c12cf25ecd

View File

@@ -70,7 +70,13 @@ $SIG{'TERM'} = 'IGNORE'; # stop process from being killed by restart
&restart_miniserv();
&webmin_log("ssl", undef, undef, \%in);
$url = "$ENV{'SERVER_NAME'}:$miniserv{'port'}/webmin/";
if ($in{'ssl'}) { &redirect("https://$url"); }
else { &redirect("http://$url"); }
$url = "$ENV{'SERVER_NAME'}:$miniserv{'port'}";
if ($in{'ssl'}) {
&redirect("https://$url");
}
else {
# Tell browser to unset HSTS policy to make non-SSL URL work
print "Strict-Transport-Security: max-age=0; includeSubDomains\n";
&redirect("http://$url");
}