File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -378,6 +378,26 @@ describe('Parse.File testing', () => {
378378 expect ( response . headers [ 'content-type' ] ) . toMatch ( / ^ t e x t \/ h t m l / ) ;
379379 } ) ;
380380
381+ it ( 'works without Content-Type and extension' , async ( ) => {
382+ await reconfigureServer ( {
383+ fileUpload : {
384+ enableForPublic : true ,
385+ } ,
386+ } ) ;
387+ const headers = {
388+ 'X-Parse-Application-Id' : 'test' ,
389+ 'X-Parse-REST-API-Key' : 'rest' ,
390+ } ;
391+ const result = await request ( {
392+ method : 'POST' ,
393+ headers : headers ,
394+ url : 'http://localhost:8378/1/files/file' ,
395+ body : '<html></html>\n' ,
396+ } ) ;
397+ expect ( result . data . url . includes ( 'file.txt' ) ) . toBeTrue ( ) ;
398+ expect ( result . data . name . includes ( 'file.txt' ) ) . toBeTrue ( ) ;
399+ } ) ;
400+
381401 it ( 'filename is url encoded' , done => {
382402 const headers = {
383403 'Content-Type' : 'text/html' ,
You can’t perform that action at this time.
0 commit comments