Socket
Socket
Sign inDemoInstall

wreck

Package Overview
Dependencies
2
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.1 to 7.0.2

13

lib/index.js

@@ -91,10 +91,15 @@ 'use strict';

uri.method = method.toUpperCase();
uri.headers = options.headers;
uri.headers = options.headers || {};
const hasContentLength = Object.keys(uri.headers).some((key) => {
return key.toLowerCase() === 'content-length';
});
const payloadSupported = (uri.method !== 'GET' && uri.method !== 'HEAD' && options.payload !== null && options.payload !== undefined);
if (payloadSupported &&
(typeof options.payload === 'string' || Buffer.isBuffer(options.payload))) {
(typeof options.payload === 'string' || Buffer.isBuffer(options.payload)) &&
(!hasContentLength)) {
uri.headers = Hoek.clone(uri.headers) || {};
uri.headers['Content-Length'] = Buffer.isBuffer(options.payload) ? options.payload.length : Buffer.byteLength(options.payload);
uri.headers = Hoek.clone(uri.headers);
uri.headers['content-length'] = Buffer.isBuffer(options.payload) ? options.payload.length : Buffer.byteLength(options.payload);
}

@@ -101,0 +106,0 @@

{
"name": "wreck",
"description": "HTTP Client Utilities",
"version": "7.0.1",
"version": "7.0.2",
"repository": "git://github.com/hapijs/wreck",

@@ -16,4 +16,4 @@ "main": "lib/index",

"dependencies": {
"boom": "3.1.x",
"hoek": "3.0.x"
"boom": "3.x.x",
"hoek": "3.x.x"
},

@@ -20,0 +20,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc