File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apps/sim/app/api/files/upload Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -458,10 +458,10 @@ describe('File Upload Security Tests', () => {
458458 expect ( response . status ) . toBe ( 200 )
459459 } )
460460
461- it ( 'should reject JavaScript files ' , async ( ) => {
461+ it ( 'should reject unsupported file types ' , async ( ) => {
462462 const formData = new FormData ( )
463- const maliciousJs = 'alert("XSS") '
464- const file = new File ( [ maliciousJs ] , 'malicious.js ' , { type : 'application/javascript ' } )
463+ const content = 'binary data '
464+ const file = new File ( [ content ] , 'archive.exe ' , { type : 'application/octet-stream ' } )
465465 formData . append ( 'file' , file )
466466 formData . append ( 'context' , 'workspace' )
467467 formData . append ( 'workspaceId' , 'test-workspace-id' )
@@ -475,7 +475,7 @@ describe('File Upload Security Tests', () => {
475475
476476 expect ( response . status ) . toBe ( 400 )
477477 const data = await response . json ( )
478- expect ( data . message ) . toContain ( "File type 'js ' is not allowed" )
478+ expect ( data . message ) . toContain ( "File type 'exe ' is not allowed" )
479479 } )
480480
481481 it ( 'should reject files without extensions' , async ( ) => {
You can’t perform that action at this time.
0 commit comments