-
Notifications
You must be signed in to change notification settings - Fork 228
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: handling of multipart/form-data requests #173
Conversation
@develohpanda Mind looking at this PR? |
@erunion I believe after merging the code that changed var -> const, this created a handful of merge conflicts. |
@reynolek Conflicts resolved. |
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.
Awesome work, thanks for putting your time into this PR! I am largely unfamiliar with this topic, and your code comments were very useful. 💯
I have just a couple of notes and questions, however nothing major nor blocking!
@develohpanda Thanks for the review, and I've addressed your feedback. |
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.
Nicely done, thanks for your explanations as well!
When will this fix be released @develohpanda? |
@johanbook I have added a card to our board to publish a new version, we'll get to it hopefully this week or next week. |
Released in 1.23.0 |
multipart/form-data
content types in order to accommodate library utilization within the browser where the nativeFormData
component is used.form-data
andFormData
that was causing the library to fail in the browser were two issues:FormData.append
has three arguments, and the third should only be present if the second is aBlob
orUSVString
. It is never an object, asform-data
requires it to be.FormData.pipe()
isn't a function.request
target that was causingfs.createReadStream
pointers to be stringified and unusable.param.fileName
if it's present, even ifparam.value
also is:request
request
target to prefer single quotes inrequire
statements andrequest.cookie
calls. Since the rest of the snippet already preferred this, this change makes the whole snippet look a touch more cohesive and consistent.Resolves #111