Comments (10)
Can you elaborate more on use case? Thank you.
from form-data.
When I use form-data upload file to wechat server(Chinese IM),It always reject my request, but wth curl it's ok. At last I compare the requests, and found the reason is the _lastBoundary lack of '\r\n'. By the way It's ok on my own server, I think It's more safe to append CRLF.
from form-data.
part code from curl
https://github.com/bagder/curl/blob/6374ab2a36e7d287039b0fc148f9079f2ae5fb97/lib/formdata.c
1359-1375
if(post->more) {
/* this was a multiple-file inclusion, make a termination file
boundary: */
result = AddFormDataf(&form, &size,
"\r\n--%s--",
fileboundary);
if(result)
break;
}
} while((post = post->next) != NULL); /* for each field */
/* end-boundary for everything */
if(CURLE_OK == result)
result = AddFormDataf(&form, &size,"\r\n--%s--\r\n",boundary);
only the last boundary should end with \r\n.
from form-data.
I'll put it to v0.2, so more people will be aware of incoming change and can test it against their endpoints. I don't have access to many different webservers to test it properly.
from form-data.
I came across this bug, too... However, formstream seems to work fine here but node-request relies on form-data instead of formstream.
At present, the workaround could be adding an extra form-data part to correctly end the previous form-data part. @hustfyb
from form-data.
I had same issue: Kong/unirest-nodejs#23 (comment)
Manually fixing _lastBoundary fixed my issue.
from form-data.
I had same issue: Kong/unirest-nodejs#23 (comment)
Manually fixing _lastBoundary fixed my issue.
Was coming here to comment about this, it's specific to .NET (you can search around, square specifically references the RFC where it's stated it doesn't matter what is after lastBoundary)
from form-data.
Was following advice here: http://debuggable.com/posts/how-to-fork-patch-npm-modules:4e2eb9f3-e584-44be-b1a9-3db7cbdd56cb
which I think might have been written by you. I'm new to npm. I followed those steps and deleted the node_modules directory and typed
npm install
thinking that it would fetch all of the packages including my patch. But it doesn't seem to do that.
from form-data.
@nijikokun thanks for the info. I figured it could be an IIS or ASP.Net thing.
from form-data.
Fixed in #123
from form-data.
Related Issues (20)
- getHeaders should add content length if known HOT 1
- Passing Uint8Array or Buffer leads to "source.on is not a function" error under Node 18 HOT 1
- Need Help Browser support HOT 3
- Final nail in the coffin HOT 1
- Is there a place to report security issues? HOT 2
- From Data HOT 1
- Is this Library Dead? HOT 1
- "form-data" is vulnerable to request tampering via a crafted filename HOT 1
- FormData is undefind
- FormData is undefind
- FormData class is confused with native FormData class in Chrome HOT 1
- Doesn't work well in node version 18 HOT 3
- any option to Read all the key and value from formdata HOT 1
- How to send an array of pdf files using form-data HOT 5
- How do I get upload progress when I submit??? HOT 1
- Mark package with sideEffects: false
- how to upload multiple files with fields at once with formdata
- Is it possible to cancel a fileupload?
- 【formData】“Error: Unexpected end of form” after multiple post file formdata, and then hang up after multiple error happening HOT 2
- Move away from `util.isArray`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form-data.