-
Notifications
You must be signed in to change notification settings - Fork 212
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
added support for fieldNameSize #59
base: master
Are you sure you want to change the base?
Conversation
lib/types/multipart.js
Outdated
: Infinity); | ||
: Infinity), | ||
fieldNameSizeLimit = (limits && typeof limits.fieldNameSize === 'number' | ||
? limits.fieldNameSize |
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.
alignment is off here
I think we should also have a I'm not sure what that would look like. Originally I tried to keep the parameters used for both |
Well, I'm glad you proposed fieldNameTruncated and not me! 👍 I had thought about incorporating it originally but thought I'd make a mistake somewhere due to me being new to this code. I'd be happy to work with you on making this happen. I'll take a fresh look at the source late tonight with what you suggested and post my thoughts then. |
I cleaned up the files per your original comments and reran the npm test (which passed). Re. truncated field. Along the lines of the idea in your first paragraph. So return an object from parseParams? That object would have the current results array and a second Boolean property for fieldNameTruncated. Then like you say you could assign that as an ending parameter to boy.emit('file', fieldname, file, filename, encoding, contype, fieldNameTruncated); Then at least this shouldn't break higher-level functionality, who may be listening to the file emitter. (eg the express/multer module). |
Any update on this? |
@jpfluger If by any chance you are still interested in landing this, would you consider rebasing this towards https://github.com/fastify/busboy? We've created a fork that we intend to maintain within the fastify organization due to original repo growing stale in the latest years, and hopefully larger community can benefit from that. |
Hi. I added support for fieldNameSize and corresponding test parameters. Kept the 100 byte default, as specified by the documentation. This way if anyone says busboy broke their implementation, well, the intention was always for the default to be 100 bytes. Only put the functionality in place for content-disposition for multi-part data. If this was wrong or I'm missing something, please let me know. Otherwise this should close issue #6 for you. Thanks for the library. I'm using it via multer and am trying to harden the security of my submission system. Oh, and added a .gitignore file. Hope that's okay too. Thanks again for the library. (p.s. I didn't give this a version bump, though)