diff --git a/spec/ParseFile.spec.js b/spec/ParseFile.spec.js index 1624007e0d..6be506be8d 100644 --- a/spec/ParseFile.spec.js +++ b/spec/ParseFile.spec.js @@ -378,6 +378,26 @@ describe('Parse.File testing', () => { expect(response.headers['content-type']).toMatch(/^text\/html/); }); + it('works without Content-Type and extension', async () => { + await reconfigureServer({ + fileUpload: { + enableForPublic: true, + }, + }); + const headers = { + 'X-Parse-Application-Id': 'test', + 'X-Parse-REST-API-Key': 'rest', + }; + const result = await request({ + method: 'POST', + headers: headers, + url: 'http://localhost:8378/1/files/file', + body: '\n', + }); + expect(result.data.url.includes('file.txt')).toBeTrue(); + expect(result.data.name.includes('file.txt')).toBeTrue(); + }); + it('filename is url encoded', done => { const headers = { 'Content-Type': 'text/html',