@@ -4377,8 +4377,7 @@ one,h,/data/h,2000-01-01T00:06,2000-01-01T00:07,-5,-6,,ee,ff
4377
4377
body . toString ( ) . should . equal ( 'testvideo' ) ;
4378
4378
} ) ) ) ) ) ) ) ;
4379
4379
4380
- // Ref https://github.com/getodk/central-backend/issues/1351
4381
- it ( 'should attach a given file with empty Content-Type' , testService ( ( service ) =>
4380
+ it ( 'should attach a given file with empty Content-Type and serve it with default mime type' , testService ( ( service ) =>
4382
4381
service . login ( 'alice' , ( asAlice ) =>
4383
4382
asAlice . post ( '/v1/projects/1/forms?publish=true' )
4384
4383
. set ( 'Content-Type' , 'application/xml' )
@@ -4394,13 +4393,12 @@ one,h,/data/h,2000-01-01T00:06,2000-01-01T00:07,-5,-6,,ee,ff
4394
4393
. expect ( 200 )
4395
4394
. then ( ( ) => asAlice . get ( '/v1/projects/1/forms/binaryType/submissions/both/attachments/my_file1.mp4' )
4396
4395
. expect ( 200 )
4397
- . then ( ( { headers, text } ) => {
4398
- headers [ 'content-type' ] . should . equal ( 'null ' ) ;
4399
- text . toString ( ) . should . equal ( 'testvideo' ) ; // use 'text' instead of 'body' to avoid supertest response parsing
4396
+ . then ( ( { headers, body } ) => {
4397
+ headers [ 'content-type' ] . should . equal ( 'application/octet-stream ' ) ;
4398
+ body . toString ( ) . should . equal ( 'testvideo' ) ;
4400
4399
} ) ) ) ) ) ) ) ;
4401
4400
4402
- // Ref https://github.com/getodk/central-backend/issues/1351
4403
- it ( 'should attach a given file with missing Content-Type' , testService ( ( service ) =>
4401
+ it ( 'should attach a given file with missing Content-Type and serve it with default mime type' , testService ( ( service ) =>
4404
4402
service . login ( 'alice' , ( asAlice ) =>
4405
4403
asAlice . post ( '/v1/projects/1/forms?publish=true' )
4406
4404
. set ( 'Content-Type' , 'application/xml' )
@@ -4416,9 +4414,9 @@ one,h,/data/h,2000-01-01T00:06,2000-01-01T00:07,-5,-6,,ee,ff
4416
4414
. expect ( 200 )
4417
4415
. then ( ( ) => asAlice . get ( '/v1/projects/1/forms/binaryType/submissions/both/attachments/my_file1.mp4' )
4418
4416
. expect ( 200 )
4419
- . then ( ( { headers, text } ) => {
4420
- headers [ 'content-type' ] . should . equal ( 'null ' ) ;
4421
- text . toString ( ) . should . equal ( 'testvideo' ) ; // use 'text' instead of 'body' to avoid supertest response parsing
4417
+ . then ( ( { headers, body } ) => {
4418
+ headers [ 'content-type' ] . should . equal ( 'application/octet-stream ' ) ;
4419
+ body . toString ( ) . should . equal ( 'testvideo' ) ;
4422
4420
} ) ) ) ) ) ) ) ;
4423
4421
4424
4422
it ( 'should log an audit entry about initial attachment' , testService ( ( service , { Audits, Forms, Submissions, SubmissionAttachments } ) =>
0 commit comments