Socket
Socket
Sign inDemoInstall

urllib

Package Overview
Dependencies
Maintainers
1
Versions
221
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urllib - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

18

lib/urllib.js

@@ -87,2 +87,3 @@ /**

}
var timer = null;
var req = request_method(options, function(res) {

@@ -95,2 +96,6 @@ var chunks = [], size = 0;

res.on('end', function() {
if (timer) {
clearTimeout(timer);
timer = null;
}
var data = null;

@@ -112,7 +117,16 @@ switch(chunks.length) {

var timeout = args.timeout;
req.setTimeout(timeout, function() {
timer = setTimeout(function() {
timer = null;
req.__isTimeout = true;
req.abort();
});
}, timeout);
// req.setTimeout(timeout, function() {
// req.__isTimeout = true;
// req.abort();
// });
req.on('error', function(err) {
if (timer) {
clearTimeout(timer);
timer = null;
}
if (req.__isTimeout) {

@@ -119,0 +133,0 @@ err.name = 'RequestTimeoutError';

2

package.json
{
"name": "urllib",
"version": "0.2.1",
"version": "0.2.2",
"description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more. Like python's _urllib_ module.",

@@ -5,0 +5,0 @@ "keywords": ["urllib", "http", "urlopen"],

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