Commit 910bed8 1 parent b284c6a commit 910bed8 Copy full SHA for 910bed8
File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ declare global {
35
35
port ?: string
36
36
host ?: string
37
37
logs ?: boolean
38
+ limit ?: string
39
+ limitFiles ?: number
38
40
}
39
41
40
42
interface Service <
Original file line number Diff line number Diff line change @@ -69,7 +69,14 @@ export const actionActions = createActions(
69
69
ctx . params . req . headers [ 'content-type' ] !== 'application/json' &&
70
70
! isInvalid
71
71
) {
72
- const form = formidable ( isRawObject ( meta . multipart ) ? meta . multipart : { } )
72
+ const form = formidable (
73
+ deepmerge (
74
+ {
75
+ maxFileSize : context . options . limitFiles ?? 20 * 1024 * 1024 ,
76
+ } ,
77
+ isRawObject ( meta . multipart ) ? meta . multipart : { }
78
+ )
79
+ )
73
80
74
81
const multipart = await group (
75
82
( ) => form . parse ( ctx . params . req ) ,
Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ export const serviceActions = createActions(
95
95
path : `${ serviceOptions . name } /${ serviceOptions . version } ` ,
96
96
aliases,
97
97
mergeParams : false ,
98
+ bodyParsers : {
99
+ json : { limit : context . options . limit ?? '100kb' } ,
100
+ urlencoded : { extended : true , limit : context . options . limit ?? '100kb' } ,
101
+ } ,
98
102
} )
99
103
100
104
if ( serviceOptions . created ) {
You can’t perform that action at this time.
0 commit comments