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

@@ -29,20 +29,21 @@ function eventsource() {
var ta = $("#output");
var upload = $( "#upload" );
var checked = "";
var token = encodeURIComponent($("#token").html());
if(upload.prop("checked"))
{
checked = "upload";
checked = "upload";
}
// IE does not support EventSource - load whole content at once
if (typeof EventSource !== "function") {
httpGet(ta,"/admin/scripts/pi-hole/php/debug.php?IE&"+checked);
httpGet(ta,"/admin/scripts/pi-hole/php/debug.php?IE&token="+token+"&"+checked);
return;
}
var host = window.location.host;
var source = new EventSource("/admin/scripts/pi-hole/php/debug.php?"+checked);
var source = new EventSource("/admin/scripts/pi-hole/php/debug.php?&token="+token+"&"+checked);
// Reset and show field
ta.empty();