Przeglądaj źródła

Added HTTP Codes to API - updated

CauseFX 6 lat temu
rodzic
commit
31a46d29e7
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      api/index.php

+ 1 - 0
api/index.php

@@ -28,6 +28,7 @@ if (!in_array($function, $approvedFunctionsBypass)) {
 	if (isApprovedRequest($method) === false) {
 	if (isApprovedRequest($method) === false) {
 		$result['status'] = "error";
 		$result['status'] = "error";
 		$result['statusText'] = "Not Authorized";
 		$result['statusText'] = "Not Authorized";
+		http_response_code(401);
 		writeLog('success', 'Killed Attack From [' . (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'No Referer') . ']', $GLOBALS['organizrUser']['username']);
 		writeLog('success', 'Killed Attack From [' . (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'No Referer') . ']', $GLOBALS['organizrUser']['username']);
 		exit(json_encode($result));
 		exit(json_encode($result));
 	}
 	}