-
Notifications
You must be signed in to change notification settings - Fork 121
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
fix: moleculer crash if file size is too large #313
base: master
Are you sure you want to change the base?
Conversation
@@ -158,7 +158,11 @@ class Alias { | |||
if (_.isFunction(busboyOptions.onFileSizeLimit)) { | |||
busboyOptions.onFileSizeLimit.call(this.service, file, busboy); | |||
} | |||
file.destroy(new PayloadTooLarge({ fieldname, filename, encoding, mimetype })); | |||
file.destroy(); | |||
busboy.emit("error", new PayloadTooLarge({ fieldname, filename, encoding, mimetype })); |
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.
Could you explain the changes?
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.
without this pull, below example will crash application
https://stackblitz.com/edit/node-3az7uh?file=index.js
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.
I've check it but I think it doesn't work well. It doesn't throw error, the response doesn't go back, but the action handler is called.
i've created this repo |
I could reproduce the issue but this PR doesn't fix it correctly. |
PR keeps moleucler to not crash, the real problem I think is due to busybox, but I don't have time to look closely. |
No description provided.