@@ -16,6 +16,7 @@ describe('buildRequest', () => {
16
16
expect ( fetchOptions . method ) . toEqual ( 'GET' ) ;
17
17
expect ( fetchOptions . headers ) . toEqual ( {
18
18
Accept : 'application/vnd.live-component+html' ,
19
+ 'X-Requested-With' : 'XMLHttpRequest' ,
19
20
} ) ;
20
21
} ) ;
21
22
@@ -38,6 +39,7 @@ describe('buildRequest', () => {
38
39
expect ( fetchOptions . headers ) . toEqual ( {
39
40
Accept : 'application/vnd.live-component+html' ,
40
41
'X-CSRF-TOKEN' : '_the_csrf_token' ,
42
+ 'X-Requested-With' : 'XMLHttpRequest' ,
41
43
} ) ;
42
44
const body = < FormData > fetchOptions . body ;
43
45
expect ( body ) . toBeInstanceOf ( FormData ) ;
@@ -100,6 +102,7 @@ describe('buildRequest', () => {
100
102
expect ( fetchOptions . headers ) . toEqual ( {
101
103
// no token
102
104
Accept : 'application/vnd.live-component+html' ,
105
+ 'X-Requested-With' : 'XMLHttpRequest' ,
103
106
} ) ;
104
107
const body = < FormData > fetchOptions . body ;
105
108
expect ( body ) . toBeInstanceOf ( FormData ) ;
@@ -180,6 +183,7 @@ describe('buildRequest', () => {
180
183
expect ( fetchOptions . headers ) . toEqual ( {
181
184
Accept : 'application/vnd.live-component+html' ,
182
185
'X-CSRF-TOKEN' : '_the_csrf_token' ,
186
+ 'X-Requested-With' : 'XMLHttpRequest' ,
183
187
} ) ;
184
188
const body = < FormData > fetchOptions . body ;
185
189
expect ( body ) . toBeInstanceOf ( FormData ) ;
@@ -204,6 +208,7 @@ describe('buildRequest', () => {
204
208
expect ( fetchOptions . headers ) . toEqual ( {
205
209
Accept : 'application/vnd.live-component+html' ,
206
210
'X-CSRF-TOKEN' : '_the_csrf_token' ,
211
+ 'X-Requested-With' : 'XMLHttpRequest' ,
207
212
} ) ;
208
213
const body = < FormData > fetchOptions . body ;
209
214
expect ( body ) . toBeInstanceOf ( FormData ) ;
0 commit comments