Skip to content

Commit 7e3c52b

Browse files
committed
feat: rawBody for json
1 parent a89c11f commit 7e3c52b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

zerva-http/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zerva/http",
33
"type": "module",
4-
"version": "0.65.1",
4+
"version": "0.65.2",
55
"description": "🌱 Zerva Express HTTP",
66
"author": {
77
"name": "Dirk Holtwick",

zerva-http/src/http.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ export function useHttp(config?: {
118118

119119
if (postJson) {
120120
log(`Post JSON, limit=${postLimit}`)
121-
app.use(express.json({ limit: postLimit }))
121+
app.use(express.json({ limit: postLimit,
122+
verify: (req, res, buf) => {
123+
if (req)
124+
(req as any).rawBody = buf
125+
} }))
122126
}
123127

124128
if (postText) {

0 commit comments

Comments
 (0)