Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nodejs] Enable Test_Blocking_request_body_multipart #3249

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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