Socket
Socket
Sign inDemoInstall

got

Package Overview
Dependencies
Maintainers
3
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

got - npm Package Compare versions

Comparing version 5.3.0 to 5.3.1

20

index.js

@@ -8,3 +8,4 @@ 'use strict';

var objectAssign = require('object-assign');
var duplexify = require('duplexify');
var PassThrough = require('readable-stream').PassThrough;
var duplexer2 = require('duplexer2');
var isStream = require('is-stream');

@@ -144,3 +145,5 @@ var readAllStream = require('read-all-stream');

function asStream(opts) {
var proxy = duplexify();
var input = new PassThrough();
var output = new PassThrough();
var proxy = duplexer2(input, output);

@@ -173,3 +176,3 @@ if (opts.json) {

if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH') {
proxy.setWritable(req);
input.pipe(req);
return;

@@ -184,3 +187,3 @@ }

proxy.setReadable(res);
res.pipe(output);

@@ -335,4 +338,9 @@ if (statusCode < 200 || statusCode > 299) {

helpers.forEach(function (el) {
got.stream[el] = function (url, opts) {
return got.stream(url, objectAssign({}, opts, {method: el.toUpperCase()}));
got.stream[el] = function (url, opts, cb) {
if (typeof opts === 'function') {
cb = opts;
opts = {};
}
return got.stream(url, objectAssign({}, opts, {method: el.toUpperCase()}), cb);
};

@@ -339,0 +347,0 @@ });

{
"name": "got",
"version": "5.3.0",
"version": "5.3.1",
"description": "Simplified HTTP/HTTPS requests",

@@ -49,3 +49,3 @@ "license": "MIT",

"create-error-class": "^2.0.0",
"duplexify": "^3.2.0",
"duplexer2": "^0.1.4",
"is-plain-obj": "^1.0.0",

@@ -60,2 +60,3 @@ "is-redirect": "^1.0.0",

"read-all-stream": "^3.0.0",
"readable-stream": "^2.0.5",
"timed-out": "^2.0.0",

@@ -62,0 +63,0 @@ "unzip-response": "^1.0.0",

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