Return HTTP 400 when operation is not found (instead of 404 page not found)

This commit is contained in:
Eric Espie
2022-10-11 15:24:42 +02:00
parent ae95cf37f5
commit 14673ff1f5

View File

@@ -174,7 +174,7 @@ abstract class Controller
}
else
{
$this->DisplayPageNotFound();
$this->DisplayBadRequest();
}
}
catch (Exception $e)
@@ -219,6 +219,15 @@ abstract class Controller
}
}
/**
* Overridable "page not found" which is more an "operation not found"
*/
public function DisplayBadRequest()
{
http_response_code(400);
die('Operation not found');
}
/**
* Overridable "page not found" which is more an "operation not found"
*/