mirror of
https://github.com/webmin/webmin.git
synced 2026-06-27 14:30:25 +01:00
Merge branch 'master' of github.com:webmin/webmin
This commit is contained in:
12
miniserv.pl
12
miniserv.pl
@@ -1447,14 +1447,16 @@ elsif ($reqline !~ /^(\S+)\s+(.*)\s+HTTP\/1\..$/) {
|
|||||||
} elsif ($config{'hide_admin_url'} != 1) {
|
} elsif ($config{'hide_admin_url'} != 1) {
|
||||||
# Tell user the correct URL
|
# Tell user the correct URL
|
||||||
&http_error(200, "Document follows",
|
&http_error(200, "Document follows",
|
||||||
|
"<noscript>".
|
||||||
|
"<h2 class=\"err-head\">Error — Document follows</h2>".
|
||||||
"This web server is running in SSL mode. ".
|
"This web server is running in SSL mode. ".
|
||||||
"Try the URL <a href='$url'>$url</a> instead.".
|
"Try the URL <a href='$url'>$url</a> instead.</noscript>".
|
||||||
"<script>".
|
"<script>".
|
||||||
"if (location.protocol != 'https:') {".
|
"if (location.protocol != 'https:') {".
|
||||||
" location.protocol = 'https:';".
|
" location.protocol = 'https:';".
|
||||||
"}".
|
"}".
|
||||||
"</script>",
|
"</script>",
|
||||||
0, 1);
|
0, 1, 1);
|
||||||
} else {
|
} else {
|
||||||
# Throw an error
|
# Throw an error
|
||||||
&http_error(404, "Page not found",
|
&http_error(404, "Page not found",
|
||||||
@@ -2846,7 +2848,7 @@ return $rv;
|
|||||||
# Output an error message to the browser, and log it to the error log
|
# Output an error message to the browser, and log it to the error log
|
||||||
sub http_error
|
sub http_error
|
||||||
{
|
{
|
||||||
my ($code, $msg, $body, $noexit, $noerr) = @_;
|
my ($code, $msg, $body, $noexit, $noerr, $nohead) = @_;
|
||||||
local $eh = $error_handler_recurse ? undef :
|
local $eh = $error_handler_recurse ? undef :
|
||||||
$config{"error_handler_".$code} ? $config{"error_handler_".$code} :
|
$config{"error_handler_".$code} ? $config{"error_handler_".$code} :
|
||||||
$config{'error_handler'} ? $config{'error_handler'} : undef;
|
$config{'error_handler'} ? $config{'error_handler'} : undef;
|
||||||
@@ -2872,7 +2874,9 @@ else {
|
|||||||
&reset_byte_count();
|
&reset_byte_count();
|
||||||
&write_data("<html>\n");
|
&write_data("<html>\n");
|
||||||
&write_data("<head>".&embed_error_styles($roots[0])."<title>$code — $msg</title></head>\n");
|
&write_data("<head>".&embed_error_styles($roots[0])."<title>$code — $msg</title></head>\n");
|
||||||
&write_data("<body class=\"err-body\"><h2 class=\"err-head\">Error — $msg</h2>\n");
|
my $errhead = "<h2 class=\"err-head\">Error — $msg</h2>";
|
||||||
|
$errhead = undef if ($nohead);
|
||||||
|
&write_data("<body class=\"err-body\">$errhead\n");
|
||||||
if ($body) {
|
if ($body) {
|
||||||
&write_data("<p class=\"err-content\">$body</p>\n");
|
&write_data("<p class=\"err-content\">$body</p>\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user