mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-12-09 08:50:05 +08:00
[Web] fix wrong content type + add more http 500 responses
This commit is contained in:
parent
3c3b9575a2
commit
db2759b7d1
@ -70,6 +70,7 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
|
// Stop when redis is not available
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
?>
|
?>
|
||||||
<center style='font-family:sans-serif;'>Connection to Redis failed.<br /><br />The following error was reported:<br/><?=$e->getMessage();?></center>
|
<center style='font-family:sans-serif;'>Connection to Redis failed.<br /><br />The following error was reported:<br/><?=$e->getMessage();?></center>
|
||||||
@ -99,6 +100,7 @@ try {
|
|||||||
}
|
}
|
||||||
catch (PDOException $e) {
|
catch (PDOException $e) {
|
||||||
// Stop when SQL connection fails
|
// Stop when SQL connection fails
|
||||||
|
http_response_code(500);
|
||||||
?>
|
?>
|
||||||
<center style='font-family:sans-serif;'>Connection to database failed.<br /><br />The following error was reported:<br/> <?=$e->getMessage();?></center>
|
<center style='font-family:sans-serif;'>Connection to database failed.<br /><br />The following error was reported:<br/> <?=$e->getMessage();?></center>
|
||||||
<?php
|
<?php
|
||||||
@ -106,6 +108,7 @@ exit;
|
|||||||
}
|
}
|
||||||
// Stop when dockerapi is not available
|
// Stop when dockerapi is not available
|
||||||
if (fsockopen("tcp://dockerapi", 443, $errno, $errstr) === false) {
|
if (fsockopen("tcp://dockerapi", 443, $errno, $errstr) === false) {
|
||||||
|
http_response_code(500);
|
||||||
?>
|
?>
|
||||||
<center style='font-family:sans-serif;'>Connection to dockerapi container failed.<br /><br />The following error was reported:<br/><?=$errno;?> - <?=$errstr;?></center>
|
<center style='font-family:sans-serif;'>Connection to dockerapi container failed.<br /><br />The following error was reported:<br/><?=$errno;?> - <?=$errstr;?></center>
|
||||||
<?php
|
<?php
|
||||||
|
@ -508,6 +508,7 @@ if (isset($_GET['query'])) {
|
|||||||
if (!isset($_SESSION['mailcow_cc_role'])){
|
if (!isset($_SESSION['mailcow_cc_role'])){
|
||||||
switch ($object) {
|
switch ($object) {
|
||||||
case 'banlist':
|
case 'banlist':
|
||||||
|
header('Content-Type: text/plain');
|
||||||
echo fail2ban('banlist', 'get', $extra);
|
echo fail2ban('banlist', 'get', $extra);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1334,6 +1335,7 @@ if (isset($_GET['query'])) {
|
|||||||
case "fail2ban":
|
case "fail2ban":
|
||||||
switch ($object) {
|
switch ($object) {
|
||||||
case 'banlist':
|
case 'banlist':
|
||||||
|
header('Content-Type: text/plain');
|
||||||
echo fail2ban('banlist', 'get', $extra);
|
echo fail2ban('banlist', 'get', $extra);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user