File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 80
80
81
81
requestStack = [],
82
82
83
+ extractHeaders = function (xhr , stackElement ) {
84
+ // Here we avoid to call xhr.getResponseHeader in order to
85
+ // prevent polluting the console with CORS security errors
86
+ var allHeaders = xhr .getAllResponseHeaders ();
87
+ var ret;
88
+
89
+ if (ret = allHeaders .match (/ ^ x-debug-token:\s + (. * )$ / im )) {
90
+ stackElement .profile = ret[1 ];
91
+ }
92
+ if (ret = allHeaders .match (/ ^ x-debug-token-link:\s + (. * )$ / im )) {
93
+ stackElement .profilerUrl = ret[1 ];
94
+ }
95
+ },
96
+
83
97
renderAjaxRequests = function () {
84
98
var requestCounter = document .querySelectorAll (' .sf-toolbar-ajax-requests' );
85
99
if (! requestCounter .length ) {
239
253
stackElement .duration = new Date () - stackElement .start ;
240
254
stackElement .loading = false ;
241
255
stackElement .error = self .status < 200 || self .status >= 400 ;
242
- stackElement . profile = self . getResponseHeader ( " X-Debug-Token " );
243
- stackElement . profilerUrl = self . getResponseHeader ( " X-Debug-Token-Link " );
256
+
257
+ extractHeaders ( self , stackElement );
244
258
245
259
Sfjs .renderAjaxRequests ();
246
260
}
You can’t perform that action at this time.
0 commit comments