-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 empty filenames are not considered a field (#26) #38
Conversation
I've marked it as draft because I haven't tested the new version with my usecase. |
You can ignore linting warnings for benchmarks, they will not fail the build, we'll fix them later. |
@@ -9,3 +9,4 @@ Major changes since the last busboy release (0.31): | |||
* Error on non-number limit rather than ignoring (#7) | |||
* Dicer is now part of the busboy itself and not an external dependency (#14) | |||
* Tests were converted to Mocha (#11, #12, #22, #23) | |||
* Empty filenames of parts are handled as `undefined` (#26) |
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.
can you also add entry to MIGRATING.md, explaining the breaking change?
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 can explain the breaking change.
'Content-Disposition: form-data; name="cont2"; filename=""', | ||
'Content-Type: text/javascript', | ||
'', | ||
'console.log("hello world");', |
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.
is this intentional?
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.
What do you mean exactly? This tests whether it's possible to use a non-json text field with empty filename. Or do you think this test isn't necessary?
Linting fixes unrelated to this PR are very welcome, but having them as a separate PR would be more convenient. |
Is this relevant to this PR? |
@Uzlopak I'd say so, and going with a config options (with |
@cyantree Please let me know if you'll need any help with this! |
Yes, this is relevant. However I wouldn't recommend using Regarding introducing a config option: If you want to fix this quickly, then yes, it would be great if you could take over because atm I only can work at this when time allows it. |
I created a new PR with your work #52 . It also ensures that we are not breaking with original busboy. |
I created another PR #53 which i think handles the whole blob issue correctly. |
Obsolete as of #53. |
This PR normalizes empty filenames to be handled as
undefined
. This allows sending multipart requests from the browser containing fields with content types which then will be handled as fields and not as files.Linting fails. I have fixed most of the issues locally however there are some missing dependencies regarding the benchmark tests. Should I add the fixes I made to this PR?
Checklist
npm run test
andnpm run benchmark
and the Code of conduct