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

gcs-resumable-upload

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gcs-resumable-upload - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

18

index.js

@@ -7,3 +7,3 @@ 'use strict'

var Pumpify = require('pumpify')
var request = require('request')
var request = require('request').defaults({ json: true })
var StreamEvents = require('stream-events')

@@ -127,4 +127,2 @@ var through = require('through2')

try { body = JSON.parse(body) } catch (e) {}
self.emit('response', resp, body)

@@ -216,7 +214,11 @@

request(authorizedReqOpts, function (err, resp, body) {
var error = err
try { body = JSON.parse(body) } catch (e) {}
if (resp.statusCode < 200 || resp.statusCode > 299) error = new Error(resp.body)
if (body && body.error) error = body.error
if (error) return callback(error)
if (err) return callback(err)
if (body && body.error) return callback(body.error)
var nonSuccess = Math.floor(resp.statusCode / 100) !== 2 // 200-299 status code
if (nonSuccess && resp.statusCode !== RESUMABLE_INCOMPLETE_STATUS_CODE) {
return callback(new Error(body))
}
callback(null, resp, body)

@@ -223,0 +225,0 @@ })

{
"name": "gcs-resumable-upload",
"version": "0.2.1",
"version": "0.2.2",
"description": "Upload a file to Google Cloud Storage with built-in resumable behavior",

@@ -5,0 +5,0 @@ "main": "index.js",

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