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

reqlib

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reqlib - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

15

dist/index.js

@@ -282,6 +282,9 @@ "use strict";

if (RE_CONTENT_TYPE_JSON.test(requestContentType)) {
state.data = (0, _stringify.default)(data);
} else if (data && data.toString && typeof data.toString === 'function') {
state.data = data.toString();
if (typeof state.data !== 'string' && !Buffer.isBuffer(state.data)) {
if (RE_CONTENT_TYPE_JSON.test(requestContentType)) {
state.data = (0, _stringify.default)(data);
} else if (data && data.toString && typeof data.toString === 'function') {
state.data = data.toString();
} // TODO: handle when state.data might not be a string or Buffer
} // apply content length header

@@ -292,2 +295,6 @@

options.headers[HTTP_HEADERS.CONTENT_LENGTH] = options.headers[HTTP_HEADERS.CONTENT_LENGTH] || Buffer.byteLength(state.data);
}
if (Buffer.isBuffer(state.data)) {
options.headers[HTTP_HEADERS.CONTENT_LENGTH] = options.headers[HTTP_HEADERS.CONTENT_LENGTH] || state.data.length;
} // setup failover if applicable

@@ -294,0 +301,0 @@

@@ -0,1 +1,6 @@

# v1.0.8 - 03/19/2019
* Removed `prepublish` NPM script in favor of `prepare`
* Added better handling around HTTP request body serialization
# v1.0.7 - 03/12/2019

@@ -2,0 +7,0 @@

{
"name": "reqlib",
"version": "1.0.7",
"version": "1.0.8",
"description": "A library to simplify REST API requests and to provide utilities for handling common REST API consumer scenarios ",

@@ -9,3 +9,3 @@ "main": "dist",

"posttest": "nyc report --reporter=text-lcov | coveralls",
"prepublish": "gulp build",
"prepare": "gulp build",
"pretest": "gulp clean && gulp lint",

@@ -12,0 +12,0 @@ "test": "NODE_ENV=test nyc mocha ./test/src",

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