File tree Expand file tree Collapse file tree 2 files changed +0
-36
lines changed Expand file tree Collapse file tree 2 files changed +0
-36
lines changed Original file line number Diff line number Diff line change @@ -43,20 +43,6 @@ describe('E2E FileTest', () => {
43
43
} ) ;
44
44
} ) ;
45
45
46
- it ( 'should allow for file uploads that pass validation without using magic numbers validation' , async ( ) => {
47
- return request ( app . getHttpServer ( ) )
48
- . post ( '/file/pass-validation-skip-magic-numbers-validation' )
49
- . attach ( 'file' , './package.json' )
50
- . field ( 'name' , 'test' )
51
- . expect ( 201 )
52
- . expect ( {
53
- body : {
54
- name : 'test' ,
55
- } ,
56
- file : readFileSync ( './package.json' ) . toString ( ) ,
57
- } ) ;
58
- } ) ;
59
-
60
46
it ( 'should throw for file uploads that do not pass validation' , async ( ) => {
61
47
return request ( app . getHttpServer ( ) )
62
48
. post ( '/file/fail-validation' )
Original file line number Diff line number Diff line change @@ -54,28 +54,6 @@ export class AppController {
54
54
} ;
55
55
}
56
56
57
- @UseInterceptors ( FileInterceptor ( 'file' ) )
58
- @Post ( 'file/pass-validation-skip-magic-numbers-validation' )
59
- uploadFileAndPassValidationWithoutMagicNumbersValidation (
60
- @Body ( ) body : SampleDto ,
61
- @UploadedFile (
62
- new ParseFilePipeBuilder ( )
63
- . addFileTypeValidator ( {
64
- fileType : 'json' ,
65
- skipMagicNumbersValidation : true ,
66
- } )
67
- . build ( {
68
- fileIsRequired : false ,
69
- } ) ,
70
- )
71
- file ?: Express . Multer . File ,
72
- ) {
73
- return {
74
- body,
75
- file : file ?. buffer . toString ( ) ,
76
- } ;
77
- }
78
-
79
57
@UseInterceptors ( FileInterceptor ( 'file' ) )
80
58
@Post ( 'file/fail-validation' )
81
59
uploadFileAndFailValidation (
You can’t perform that action at this time.
0 commit comments