Skip to content

Commit 938526c

Browse files
authored
Check for unsafe header (php-debugbar#308)
Some headers are unsafe to read (in Chrome), checking all returned headers will prevent these errors. See barryvdh/laravel-debugbar#384
1 parent e7f2b72 commit 938526c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/DebugBar/Resources/debugbar.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,10 @@ if (typeof(PhpDebugBar) == 'undefined') {
10191019
* @return {Bool}
10201020
*/
10211021
handle: function(xhr) {
1022+
// Check if the debugbar header is available
1023+
if (xhr.getAllResponseHeaders().indexOf(this.headerName) === -1){
1024+
return true;
1025+
}
10221026
if (!this.loadFromId(xhr)) {
10231027
return this.loadFromData(xhr);
10241028
}

0 commit comments

Comments
 (0)