-
Notifications
You must be signed in to change notification settings - Fork 77
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
Configurable function input size #792
Conversation
Signed-off-by: Ivo Yankov <[email protected]>
Codecov ReportBase: 72.60% // Head: 72.62% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #792 +/- ##
==========================================
+ Coverage 72.60% 72.62% +0.01%
==========================================
Files 29 29
Lines 1734 1735 +1
Branches 318 319 +1
==========================================
+ Hits 1259 1260 +1
+ Misses 385 384 -1
- Partials 90 91 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -52,7 +52,8 @@ export default class KoaJsonRpc { | |||
|
|||
constructor(logger: Logger, register: Registry, opts?) { | |||
this.koaApp = new Koa(); | |||
this.limit = '1mb'; | |||
const limit = process.env.INPUT_SIZE_LIMIT || 1; | |||
this.limit = limit + 'mb'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of weird that this.limit
can be overwritten if you send in opts
and it has a limit
below in line 62. We should probably only use one potential mechanism for setting this configuration value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree with @lukelee-sl
Signed-off-by: Ivo Yankov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Conflicts: # README.md
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description:
Adds an
env
variable to control the maximum allowed input size (in mb). By default it is 1mbRelated issue(s):
Fixes #765
Notes for reviewer:
Checklist