Skip to content

Commit 200fb7f

Browse files
committed
fix: bump up post request body-limit to accomodate larger forms.
1 parent 9db8772 commit 200fb7f

File tree

8 files changed

+99
-13969
lines changed

8 files changed

+99
-13969
lines changed

package-lock.json

Lines changed: 92 additions & 13963 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"@types/passport": "1.0.12",
8787
"@types/supertest": "2.0.12",
8888
"@typescript-eslint/eslint-plugin": "5.55.0",
89+
"@typescript-eslint/parser": "^6.7.0",
8990
"clever-tools": "2.10.1",
9091
"commander": "9.5.0",
9192
"eslint": "8.36.0",

src/server/feat/backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const backend = ({
7474
adminEmails.map((e) => console.log(` - ${e}`))
7575
const getAuthCookie = authCookie(cookieLifetimeSeconds ?? 1800, adminEmails)
7676
app.use(cookieParser(cookieSecret ?? ulid()))
77-
app.use(bodyParser.json({ strict: true }))
77+
app.use(bodyParser.json({ strict: true, limit: '250kb' }))
7878
app.use(
7979
(
8080
err: Error | undefined,

src/server/routes/assessment/assessment.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('Assessment API', () => {
8080

8181
app = express()
8282
app.use(cookieParser('cookie-secret'))
83-
app.use(bodyParser.json({ strict: true }))
83+
app.use(bodyParser.json({ strict: true, limit: '250kb' }))
8484
app.use(passport.initialize())
8585
const cookieAuth = passport.authenticate('cookie', { session: false })
8686
passport.use(cookieAuthStrategy)

src/server/routes/authentication.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Authentication API', () => {
6060
beforeAll(async () => {
6161
app = express()
6262
app.use(cookieParser('cookie-secret'))
63-
app.use(bodyParser.json({ strict: true }))
63+
app.use(bodyParser.json({ strict: true, limit: '250kb' }))
6464
app.use(passport.initialize())
6565
app.post(
6666
'/register',

src/server/routes/correction/correction.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('Correction API', () => {
9292

9393
app = express()
9494
app.use(cookieParser('cookie-secret'))
95-
app.use(bodyParser.json({ strict: true }))
95+
app.use(bodyParser.json({ strict: true, limit: '250kb' }))
9696
app.use(passport.initialize())
9797
const cookieAuth = passport.authenticate('cookie', { session: false })
9898
passport.use(cookieAuthStrategy)

src/server/routes/form/form.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('Form API', () => {
3131
cleanups.push(cleanupFormStorage)
3232

3333
app = express()
34-
app.use(bodyParser.json({ strict: true }))
34+
app.use(bodyParser.json({ strict: true, limit: '250kb' }))
3535
app.get('/form/:id', formGetHandler({ storage: formStorage }))
3636
app.post(
3737
'/form',

src/server/routes/schema/schema.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Schema API', () => {
1616

1717
beforeAll(async () => {
1818
app = express()
19-
app.use(bodyParser.json({ strict: true }))
19+
app.use(bodyParser.json({ strict: true, limit: '250kb' }))
2020
app.get(
2121
'/schema/0.0.0-development/form',
2222
schemaHandler(

0 commit comments

Comments
 (0)