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
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
{
"statusCode": 400,
"message": "SyntaxError: Unexpected end of JSON input"
}
Minimal reproduction of the problem with instructions
Boilerplate nestjs application, any post endpoint, any invalid json POST.
What is the motivation / use case for changing the behavior?
If I enable my global AnyExceptionFilter and log the exception, I get a 400 statuscode.
{ SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at parse (/Users/name/Downloads/avgAPI/node_modules/body-parser/lib/types/json.js:88:17)
at /Users/name/Downloads/avgAPI/node_modules/body-parser/lib/read.js:116:18
at invokeCallback (/Users/name/Downloads/avgAPI/node_modules/raw-body/index.js:262:16)
at done (/Users/name/Downloads/avgAPI/node_modules/raw-body/index.js:251:7)
at IncomingMessage.onEnd (/Users/name/Downloads/avgAPI/node_modules/raw-body/index.js:307:7)
at emitNone (events.js:106:13)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
body: '{\n "email": "[email protected]",\n "password": "secret"',
status: 400,
statusCode: 400 }
Environment
Nest version: 4.6.3
For Tooling issues:
- Node version: 8.9.1
- Platform: Mac
Others:
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Current behavior
curl -X POST "http://localhost:3000/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"email\": \"[email protected]\", \"password\": \"secret\""
Expected behavior
curl -X POST "http://localhost:3000/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"email\": \"[email protected]\", \"password\": \"secret\""
Or even better:
Minimal reproduction of the problem with instructions
Boilerplate nestjs application, any post endpoint, any invalid json POST.
What is the motivation / use case for changing the behavior?
If I enable my global AnyExceptionFilter and log the exception, I get a 400 statuscode.
Environment
The text was updated successfully, but these errors were encountered: