File tree 1 file changed +20
-0
lines changed
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', () => {
378
378
expect ( response . headers [ 'content-type' ] ) . toMatch ( / ^ t e x t \/ h t m l / ) ;
379
379
} ) ;
380
380
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
+
381
401
it ( 'filename is url encoded' , done => {
382
402
const headers = {
383
403
'Content-Type' : 'text/html' ,
You can’t perform that action at this time.
0 commit comments