File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 243
243
var oldFetch = window .fetch ;
244
244
window .fetch = function () {
245
245
var promise = oldFetch .apply (this , arguments );
246
- if (! arguments [0 ].match (new RegExp ({{ excluded_ajax_paths| json_encode| raw }}))) {
246
+ var url = arguments [0 ];
247
+ var params = arguments [1 ];
248
+ var paramType = Object .prototype .toString .call (arguments [0 ]);
249
+ if (paramType === ' [object Request]' ) {
250
+ url = arguments [0 ].url ;
251
+ params = {
252
+ method: arguments [0 ].method ,
253
+ credentials: arguments [0 ].credentials ,
254
+ headers: arguments [0 ].headers ,
255
+ mode: arguments [0 ].mode ,
256
+ redirect: arguments [0 ].redirect
257
+ };
258
+ }
259
+ if (! url .match (new RegExp ({{ excluded_ajax_paths| json_encode| raw }}))) {
247
260
var method = ' GET' ;
248
- if (arguments [ 1 ] && arguments [ 1 ] .method !== undefined ) {
249
- method = arguments [ 1 ] .method ;
261
+ if (params && params .method !== undefined ) {
262
+ method = params .method ;
250
263
}
251
264
252
265
var stackElement = {
253
266
loading: true ,
254
267
error: false ,
255
- url: arguments [ 0 ] ,
268
+ url: url ,
256
269
method: method,
257
270
type: ' fetch' ,
258
271
start: new Date ()
You can’t perform that action at this time.
0 commit comments