You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const form = new FormData();
form.append('name', fs.createReadStream('path'));
var net= require('electron').net
var request = net.request({
method: 'post',
url: 'https://example.org/upload',
headers: headers
});
form.pipe(request);
request.on('response', function(res) {
});
i have a server error "unexpected end of stream". Its' possible to have this error when the Content Lenght header is different to size stream. when i use postman or got npm the upload is success.
i see it's impossible to set the content lenght header with net.request
Thanks
Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Thanks for reporting this and helping to make Electron better!
Because of time constraints, triaging code with third-party dependencies is usually not feasible for a small team like Electron's.
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
I'm adding the blocked/need-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
Preflight Checklist
Electron Version
18.0.0
What operating system are you using?
Windows
Operating System Version
Windows 10
What arch are you using?
ia32
Last Known Working Electron version
No response
Expected Behavior
the upload file success with this code
const FormData = require('form-data');
const fs = require('fs-extra');
const form = new FormData();
form.append('name', fs.createReadStream('path'));
var net= require('electron').net
var request = net.request({
method: 'post',
url: 'https://example.org/upload',
headers: headers
});
form.pipe(request);
request.on('response', function(res) {
});
Actual Behavior
const FormData = require('form-data');
const fs = require('fs-extra');
const form = new FormData();
form.append('name', fs.createReadStream('path'));
var net= require('electron').net
var request = net.request({
method: 'post',
url: 'https://example.org/upload',
headers: headers
});
form.pipe(request);
request.on('response', function(res) {
});
i have a server error "unexpected end of stream". Its' possible to have this error when the Content Lenght header is different to size stream. when i use postman or got npm the upload is success.
i see it's impossible to set the content lenght header with net.request
Thanks
Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: