php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

data from fetch not available

Open tsia opened this issue 8 months ago • 0 comments

i might be holding it wrong but i currently can't get data from fetch() requests to be handled.

i have enabled sendDataInHeaders() and i can see the phpdebugbar HTTP Header in the response but php-debugbar doesn't show anything. i did some digging and it seems like fetch() isn't wrapped at all unless i call setBindAjaxHandlerToFetch() (which i couldn't find in the documentation anywhere). if i do that, fetch() is wrapped correctly but still no data is available.

after some more digging i found this check if(... !response.headers.has(this.headerName + '-id')) in src/DebugBar/Resources/debugbar.js:1343 which doesn't make sense to me since that header isn't there but the header this.headerName is available. the check for XHR however only checks for this.headerName and not this.headerName + '-id'.

tsia avatar Mar 16 '25 23:03 tsia