You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
POST request with empty body. Expect to get 415 status code, and response body set in server.use((err, req, res, next) => {})
The issue is for 4.2.1, works as expected in 4.2.0.
To Reproduce
import request from 'supertest'
...
it('should return 415 to a omitted request body', done => {
request(server)
.post('/api/v1/users/login')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(415)
.end(function(err, res) {
console.log(res.body)
if (err) return done(err)
done()
})
})
Actual behavior
Statuc code: 500
Content-Type: text/html; charset=utf-8
Body: {}
Expected behavior
Statuc code: 415
Content-Type: application/json
Body: set in server.use((err, req, res, next) => {})
The text was updated successfully, but these errors were encountered:
Describe the bug
POST request with empty body. Expect to get 415 status code, and response body set in server.use((err, req, res, next) => {})
The issue is for 4.2.1, works as expected in 4.2.0.
To Reproduce
Actual behavior
Statuc code: 500
Content-Type: text/html; charset=utf-8
Body: {}
Expected behavior
Statuc code: 415
Content-Type: application/json
Body: set in server.use((err, req, res, next) => {})
The text was updated successfully, but these errors were encountered: