I'm using multer to handle file uploads in my express app, and I'm also using node-sspi for ntlm authentication.
When uploading a file with curl, all works fine. But when I try doing the same with supertest it doesn't work.
Supertest does work with just the auth or just the upload, but I haven't succeed in working with both of them together.
working curl command: curl -u user:pass --ntlm -F upload=@filename http://localhost
Supertest code that does not work:
request(app)
.post('/upload')
.auth(username, password)
.attach('upload', fileToUpload)
.expect(200)
If I omit the attach
or the auth
- it works (of course I need to disable auth on server side, but in general I can upload)
So, someone knows how to upload a file with auth using supertest?
Also posted as an issue on supertest's GitHub