Feature(s) impacted
Authentication
Observed behavior
Say we start the server this way:
...
const agent = await buildAgent();
const app = express();
await agent.mountOnExpress(app).start();
app.listen(env.PORT);
...
Now I want to add a middleware to control the JSON payload limit like:
const agent = await buildAgent();
const app = express();
app.use(express.json({ limit: '5mb' }));
await agent.mountOnExpress(app).start();
app.listen(env.PORT);
Now the server will return a code 500 on the route /forest/authentication
.
Expected behavior
The route /forest/authentication
returns a code 200.
Failure Logs
InternalServerError: stream is not readable
at readStream (/project/node_modules/raw-body/index.js:178:17)
at executor (/project/node_modules/raw-body/index.js:113:5)
at new Promise (<anonymous>)
at getRawBody (/project/node_modules/raw-body/index.js:112:10)
at module.exports [as json] (/project/node_modules/co-body/lib/json.js:39:21)
at parseBody (/project/node_modules/koa-bodyparser/index.js:100:26)
at bodyParser (/project/node_modules/koa-bodyparser/index.js:85:25)
at dispatch (/project/node_modules/koa-compose/index.js:42:32)
at /project/node_modules/@koa/router/lib/router.js:372:16
at dispatch (/project/node_modules/koa-compose/index.js:42:32)
Context
- Environment name: dev
- Agent type & version:
"@forestadmin/agent": "^1.4.5",
"express": "~4.17.1",
Thanks for your help