@@ -4657,7 +4657,8 @@ addEventListener('fetch', event => {});`
4657
4657
[ "f05e28a3d0bdb90d3cf4bdafe592488f" ] ,
4658
4658
[ "0de3dd5df907418e9730fd2bd747bd5e" ] ,
4659
4659
] ;
4660
- const uploadHeaders : ( string | null ) [ ] = [ ] ;
4660
+ const uploadAuthHeaders : ( string | null ) [ ] = [ ] ;
4661
+ const uploadContentTypeHeaders : ( string | null ) [ ] = [ ] ;
4661
4662
msw . use (
4662
4663
http . post (
4663
4664
`*/accounts/some-account-id/workers/scripts/test-name/assets-upload-session` ,
@@ -4679,11 +4680,12 @@ addEventListener('fetch', event => {});`
4679
4680
http . post (
4680
4681
"*/accounts/some-account-id/workers/assets/upload" ,
4681
4682
async ( { request } ) => {
4683
+ uploadContentTypeHeaders . push ( request . headers . get ( "Content-Type" ) ) ;
4684
+ uploadAuthHeaders . push ( request . headers . get ( "Authorization" ) ) ;
4682
4685
const body = ( await request . text ( ) )
4683
4686
. split ( "\n" )
4684
4687
. map ( ( x ) => JSON . parse ( x ) ) as UploadPayloadFile [ ] ;
4685
4688
bodies . push ( body ) ;
4686
- uploadHeaders . push ( request . headers . get ( "Authorization" ) ) ;
4687
4689
if ( bodies . length === mockBuckets . length ) {
4688
4690
return HttpResponse . json (
4689
4691
{
@@ -4714,12 +4716,18 @@ addEventListener('fetch', event => {});`
4714
4716
expectedType : "none" ,
4715
4717
} ) ;
4716
4718
await runWrangler ( "deploy" ) ;
4717
- expect ( uploadHeaders ) . toStrictEqual ( [
4719
+ expect ( uploadAuthHeaders ) . toStrictEqual ( [
4718
4720
"Bearer <<aus-token>>" ,
4719
4721
"Bearer <<aus-token>>" ,
4720
4722
"Bearer <<aus-token>>" ,
4721
4723
"Bearer <<aus-token>>" ,
4722
4724
] ) ;
4725
+ expect ( uploadContentTypeHeaders ) . toStrictEqual ( [
4726
+ "application/jsonl" ,
4727
+ "application/jsonl" ,
4728
+ "application/jsonl" ,
4729
+ "application/jsonl" ,
4730
+ ] ) ;
4723
4731
expect ( bodies . map ( ( b ) => b . length ) . sort ( ) ) . toEqual ( [ 1 , 1 , 1 , 2 ] ) ;
4724
4732
expect ( bodies . flatMap ( ( b ) => b ) ) . toEqual (
4725
4733
expect . arrayContaining ( [
0 commit comments