Skip to content

Commit

Permalink
[nodejs] Enable Test_Blocking_request_body_multipart (#3249)
Browse files Browse the repository at this point in the history
  • Loading branch information
iunanua authored Oct 29, 2024
1 parent 9709e9f commit ee67d34
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manifests/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ tests/:
Test_Blocking_request_body:
'*': *ref_3_19_0
nextjs: missing_feature
Test_Blocking_request_body_multipart: missing_feature
Test_Blocking_request_body_multipart:
'*': *ref_5_25_0
nextjs: missing_feature
Test_Blocking_request_cookies:
'*': *ref_4_16_0
nextjs: missing_feature
Expand Down
8 changes: 8 additions & 0 deletions utils/build/docker/nodejs/express4-typescript/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const passport = require('passport')
const { Kafka } = require("kafkajs")
const { spawnSync } = require('child_process');

const multer = require('multer')
const uploadToMemory = multer({ storage: multer.memoryStorage(), limits: { fileSize: 200000 } })

const iast = require('./iast')

iast.initData().catch(() => {})
Expand Down Expand Up @@ -40,6 +43,11 @@ app.get('/healthcheck', (req: Request, res: Response) => {
});
})

app.post('/waf', uploadToMemory.single('foo'), (req: Request, res: Response) => {
res.send('Hello\n')
})


app.all(['/waf', '/waf/*'], (req: Request, res: Response) => {
res.send('Hello\n');
});
Expand Down
1 change: 1 addition & 0 deletions utils/build/docker/nodejs/express4-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"kafkajs": "^2.2.4",
"ldapjs": "2.0.0",
"mongodb": "^6.1.0",
"multer": "^1.4.5-lts.1",
"passport": "^0.6.0",
"passport-http": "^0.3.0",
"passport-local": "^1.0.0",
Expand Down
7 changes: 7 additions & 0 deletions utils/build/docker/nodejs/express4/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const pgsql = require('./integrations/db/postgres')
const mysql = require('./integrations/db/mysql')
const mssql = require('./integrations/db/mssql')

const multer = require('multer')
const uploadToMemory = multer({ storage: multer.memoryStorage(), limits: { fileSize: 200000 } })

const { kinesisProduce, kinesisConsume } = require('./integrations/messaging/aws/kinesis')
const { snsPublish, snsConsume } = require('./integrations/messaging/aws/sns')
const { sqsProduce, sqsConsume } = require('./integrations/messaging/aws/sqs')
Expand Down Expand Up @@ -48,6 +51,10 @@ app.get('/healthcheck', (req, res) => {
})
})

app.post('/waf', uploadToMemory.single('foo'), (req, res) => {
res.send('Hello\n')
})

app.all(['/waf', '/waf/*'], (req, res) => {
res.send('Hello\n')
})
Expand Down
1 change: 1 addition & 0 deletions utils/build/docker/nodejs/express4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"ldapjs": "2.0.0",
"mongodb": "^6.1.0",
"mssql": "^9.1.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.5.0",
"passport": "^0.6.0",
"passport-http": "^0.3.0",
Expand Down

0 comments on commit ee67d34

Please sign in to comment.