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 2.0.0 to 2.1.0

4

lib/fetch.js

@@ -175,3 +175,5 @@ 'use strict';

if (res.statusCode >= 300) {
fetchRes.statusCode = res.statusCode;
if (res.statusCode >= 300 && !options.allowErrorResponse) {
finished = true;

@@ -178,0 +180,0 @@ fetchRes.emit('error', new Error('Invalid status code ' + res.statusCode));

{
"name": "nodemailer-fetch",
"version": "2.0.0",
"version": "2.1.0",
"description": "GET HTTP contents",

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

@@ -40,2 +40,3 @@ # nodemailer-fetch

* **headers** custom headers as an object where key is the header key and value is either a string or an array of strings for multiple values
* **allowErrorResponse** of true then processes response even if the response code is non 2xx

@@ -42,0 +43,0 @@ ```javascript

@@ -340,2 +340,20 @@ /* eslint no-unused-expressions:0, prefer-arrow-callback:0 */

it('should allow invalid status', function (done) {
let req = fetch('http://localhost:' + HTTP_PORT + '/invalid', {
allowErrorResponse: true
});
let buf = [];
req.on('data', function (chunk) {
buf.push(chunk);
});
req.on('error', function (err) {
expect(err).to.not.exist;
});
req.on('end', function () {
expect(req.statusCode).to.equal(500);
expect(Buffer.concat(buf).toString()).to.equal('Hello World HTTP\n');
done();
});
});
it('should return error for invalid url', function (done) {

@@ -342,0 +360,0 @@ let req = fetch('http://localhost:99999999/');

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