Skip to content

Commit

Permalink
chore(log): add env for request payload limit (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
0fatal authored Aug 4, 2023
1 parent c828c73 commit f5f4319
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions services/log-server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ export default class Config {
}
return process.env.JWT_SECRET
}

static get REQUEST_PAYLOAD_LIMIT(): string {
return process.env.REQUEST_PAYLOAD_LIMIT || '16mb'
}
}
4 changes: 2 additions & 2 deletions services/log-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ process.on('uncaughtException', (err) => {
logger.error('Caught uncaughtException:', err)
})

app.use(express.json({ limit: '3mb' }))
app.use(express.json({ limit: Config.REQUEST_PAYLOAD_LIMIT }))
app.use(
express.urlencoded({
limit: '3mb',
limit: Config.REQUEST_PAYLOAD_LIMIT,
extended: true,
}),
)
Expand Down

0 comments on commit f5f4319

Please sign in to comment.