Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

subtext

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subtext - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

15

lib/index.js

@@ -291,2 +291,7 @@ 'use strict';

// Set stream timeout
const clientTimeout = this.settings.timeout;
let clientTimeoutId = null;
const dispenser = new Pez.Dispenser(contentType);

@@ -305,2 +310,3 @@

clearTimeout(clientTimeoutId);
dispenser.removeListener('error', onError);

@@ -319,2 +325,11 @@ dispenser.removeListener('part', onPart);

if (clientTimeout &&
clientTimeout > 0) {
clientTimeoutId = setTimeout(() => {
return next(Boom.clientTimeout());
}, clientTimeout);
}
const set = (name, value) => {

@@ -321,0 +336,0 @@

2

package.json
{
"name": "subtext",
"description": "HTTP payload parsing",
"version": "3.0.0",
"version": "3.0.1",
"repository": "git://github.com/hapijs/subtext",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -1470,2 +1470,38 @@ 'use strict';

});
it('will timeout correctly for a multipart payload with output as stream', (done) => {
const path = Path.join(__dirname, './file/image.jpg');
const fileStream = Fs.createReadStream(path);
const form = new FormData();
form.append('my_file', fileStream);
form.headers = form.getHeaders();
Subtext.parse(form, null, { parse: true, output: 'stream', timeout: 1 }, (err, parsed) => {
expect(err).to.exist();
expect(err.message).to.equal('Request Timeout');
expect(err.output.statusCode).to.equal(408);
done();
});
});
it('will timeout correctly for a multipart payload with output file', (done) => {
const path = Path.join(__dirname, './file/image.jpg');
const fileStream = Fs.createReadStream(path);
const form = new FormData();
form.append('my_file', fileStream);
form.headers = form.getHeaders();
Subtext.parse(form, null, { parse: true, output: 'file', timeout: 1 }, (err, parsed) => {
expect(err).to.exist();
expect(err.message).to.equal('Request Timeout');
expect(err.output.statusCode).to.equal(408);
done();
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc