Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Work around race condition

It seems like connections are dying randomly when not sending
a content-length header.
  • Loading branch information...
commit ac041fc239cd77657500eea1ebefac1bc0860893 1 parent 3f11e89
@felixge authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 test/system/test-multi-video-upload.js
View
8 test/system/test-multi-video-upload.js
@@ -38,12 +38,16 @@ server.addListener('request', function(req, res) {
server.listen(TEST_PORT, function() {
var client = http.createClient(TEST_PORT)
- , headers = {'content-type': 'multipart/form-data; boundary='+BOUNDARY}
+ , stat = fs.statSync(FIXTURE)
+ , headers =
+ { 'content-type': 'multipart/form-data; boundary='+BOUNDARY
+ , 'content-length': stat.size
+ }
, request = client.request('POST', '/', headers)
, fixture = new fs.ReadStream(FIXTURE);
fixture
- .addListener('data', function(b) {;
+ .addListener('data', function(b) {
request.write(b);
})
.addListener('end', function() {
Please sign in to comment.
Something went wrong with that request. Please try again.