Require CSRF token for debug log generation

This commit is contained in:
Mcat12
2017-04-02 19:23:03 -04:00
parent d956c35c24
commit 4d9d9dc949
2 changed files with 16 additions and 3 deletions

View File

@@ -5,6 +5,18 @@ ob_implicit_flush(true);
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
require "password.php";
require "auth.php";
if(!$auth) {
die("Unauthorized");
}
check_cors();
$token = isset($_GET["token"]) ? $_GET["token"] : "";
check_csrf($token);
function echoEvent($datatext) {
if(!isset($_GET["IE"]))
echo "data: ".implode("\ndata: ", explode("\n", $datatext))."\n\n";