Outputrest : manage the http_response_code() if set

This commit is contained in:
2021-05-19 15:47:25 +02:00
parent e7c6833d2d
commit ecc0239106

View File

@@ -32,9 +32,10 @@ class Outputrest extends Output
$layout = FALSE, $replacement = array(),
$variable = array (), $module = "")
{
if (! isset ($variable["exceptionCode"]))
$variable["exceptionCode"] = 200;
$code = http_response_code();
if (isset ($variable["exceptionCode"]))
$code = $variable["exceptionCode"];
$rest = new Rest ();
$rest->display ($data, $variable["exceptionCode"]);
$rest->display ($data, $code);
}
}