mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 02:09:58 +01:00
Require CSRF token for debug log generation
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user