CodeIgniter Forums
Refused to get unsafe header "Debugbar-Time" - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Refused to get unsafe header "Debugbar-Time" (/showthread.php?tid=79342)



Refused to get unsafe header "Debugbar-Time" - sfarzoso - 05-31-2021

I'm using the latest version of DataTables and for some reason when I include the "ajax" parameter like this:
PHP Code:
var tableResource = $('#table-resource').DataTable({
        processingtrue,
        serverSidetrue,
        autoWidthfalse,
        order: [
            [1'asc']
        ],
        ajax: {
            url'<?= route_to('admin/blog/resource') ?>',
            method'GET'
        }, 

I get this console error:
PHP Code:
debugbar:74 Refused to get unsafe header "Debugbar-Time" 

in particular on this function:
PHP Code:
function newXHR() {
 var 
realXHR = new oldXHR();
 
realXHR.addEventListener("readystatechange", function() {
 
// Only success responses and URLs that do not contains "debugbar_time" are tracked
 
if (realXHR.readyState === && realXHR.status.toString()[0] === '2' && realXHR.responseURL.indexOf('debugbar_time') === -1) {
 var 
debugbarTime realXHR.getResponseHeader('Debugbar-Time');
 if (
debugbarTime) {
 var 
h2 document.querySelector('#ci-history > h2');
 if(
h2) {
 
h2.innerHTML 'History <small>You have new debug data.</small> <button onclick="loadDoc(' debugbarTime ')">Update</button>';
 var 
badge document.querySelector('a[data-tab="ci-history"] > span > .badge');
 
badge.className += ' active';
 }
 }
 }
 }, 
false);
 return 
realXHR;
}

I suppose there is a conflict with CI4 with ajax request or am I doing something wrong