Sha256: 5692ed1d616c287451698105b752682b50b36adcc3f531c35bdcf5ba371d66d2

Contents?: true

Size: 828 Bytes

Versions: 119

Compression:

Stored size: 828 Bytes

Contents

var common = require('../common');
var assert = common.assert;
var DelayedStream = common.DelayedStream;
var http = require('http');

var UPLOAD = new Buffer(10 * 1024 * 1024);

var server = http.createServer(function(req, res) {
  var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length});

  setTimeout(function() {
    res.writeHead(200);
    delayed.pipe(res);
  }, 10);
});
server.listen(common.PORT, function() {
  var request = http.request({
    method: 'POST',
    port: common.PORT,
  });

  request.write(UPLOAD);
  request.end();

  request.on('response', function(res) {
    var received = 0;
    res
      .on('data', function(chunk) {
        received += chunk.length;
      })
      .on('end', function() {
        assert.equal(received, UPLOAD.length);
        server.close();
      });
  });
});


Version data entries

119 entries across 105 versions & 6 rubygems

Version Path
trusty-festivity-extension-2.5.2 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.5.1 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.5.0 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.4.6 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.4.5 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.4.4 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.4.3 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.4.2 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.4.1 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.4.0 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.30 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.29 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.28 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.27 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.26 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.25 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.24 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.23 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.22 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
trusty-festivity-extension-2.3.21 node_modules/bower/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js