mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
interfaces: correct content-type match, it can have ;charset etc. suffix
PR: https://forum.opnsense.org/index.php?topic=5709.0
This commit is contained in:
parent
5739487938
commit
54ae88aea3
@ -1400,7 +1400,7 @@ include("head.inc");
|
||||
type: 'post',
|
||||
data: 'isAjax=true&ipprotocol=inet' + defaultgw + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip),
|
||||
error: function(request, textStatus, errorThrown){
|
||||
if (textStatus === "error" && request.getResponseHeader("Content-Type") === "text/plain") {
|
||||
if (textStatus === "error" && request.getResponseHeader("Content-Type").indexOf("text/plain") === 0) {
|
||||
alert(request.responseText);
|
||||
} else {
|
||||
alert("Sorry, we could not create your IPv4 gateway at this time.");
|
||||
@ -1433,7 +1433,7 @@ include("head.inc");
|
||||
type: 'post',
|
||||
data: 'isAjax=true&ipprotocol=inet6' + defaultgw + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip),
|
||||
error: function(request, textStatus, errorThrown){
|
||||
if (textStatus === "error" && request.getResponseHeader("Content-Type") === "text/plain") {
|
||||
if (textStatus === "error" && request.getResponseHeader("Content-Type").indexOf("text/plain") === 0) {
|
||||
alert(request.responseText);
|
||||
} else {
|
||||
alert("Sorry, we could not create your IPv6 gateway at this time.");
|
||||
|
||||
@ -437,9 +437,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (!empty($_REQUEST['isAjax'])) {
|
||||
header("HTTP/1.0 500 Internal Server Error");
|
||||
header("Content-type: text/plain");
|
||||
foreach ($input_errors as $error) {
|
||||
echo("$error\n");
|
||||
}
|
||||
echo implode("\n\n", $input_errors);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user