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

nodemailer-fetch

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemailer-fetch - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

4

CHANGELOG.md
# Changelog
## v1.2.1 2016-01-18
* Enclose http.request into try..catch to get url parse errors
## v1.2.0 2016-01-18

@@ -4,0 +8,0 @@

40

lib/fetch.js

@@ -56,9 +56,27 @@ 'use strict';

var req = handler.get({
host: parsed.hostname,
path: parsed.path,
port: parsed.port ? parsed.port : (parsed.protocol === 'https:' ? 443 : 80),
headers: headers,
rejectUnauthorized: false,
agent: false
var req;
try {
req = handler.get({
host: parsed.hostname,
path: parsed.path,
port: parsed.port ? parsed.port : (parsed.protocol === 'https:' ? 443 : 80),
headers: headers,
rejectUnauthorized: false,
agent: false
});
} catch (E) {
finished = true;
setImmediate(function () {
fetchRes.emit('error', E);
});
return fetchRes;
}
req.on('error', function (err) {
if (finished) {
return;
}
finished = true;
fetchRes.emit('error', err);
});

@@ -129,11 +147,3 @@

req.on('error', function (err) {
if (finished) {
return;
}
finished = true;
fetchRes.emit('error', err);
});
return fetchRes;
}
{
"name": "nodemailer-fetch",
"version": "1.2.0",
"version": "1.2.1",
"description": "GET HTTP contents",

@@ -5,0 +5,0 @@ "main": "lib/fetch.js",

@@ -312,2 +312,15 @@ /* eslint no-unused-expressions:0 */

it('should return error for invalid url', function (done) {
var req = fetch('http://localhost:99999999/');
var buf = [];
req.on('data', function (chunk) {
buf.push(chunk);
});
req.on('error', function (err) {
expect(err).to.exist;
done();
});
req.on('end', function () {});
});
it('should handle basic HTTP auth', function (done) {

@@ -314,0 +327,0 @@ var req = fetch('http://user:pass@localhost:' + HTTP_PORT + '/auth');

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