Socket
Socket
Sign inDemoInstall

pubnub

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubnub - npm Package Compare versions

Comparing version 3.1.6 to 3.1.7

2

package.json
{
"name": "pubnub",
"preferGlobal": false,
"version": "3.1.6",
"version": "3.1.7",
"author": "Pubnub <stephen@pubnub.com>",

@@ -6,0 +6,0 @@ "description": "Publish & Subscribe Real-time Messaging with PubNub",

@@ -108,2 +108,3 @@ /* ---------------------------------------------------------------------------

, failed = 0
, body = ''
, fail = function(e) {

@@ -113,25 +114,23 @@ if (failed) return;

(setup.fail||function(){})(e);
}, body = ''
, client = http.createClient( 80, origin, ssl )
, request = client.request( 'GET', url, { 'host': origin });
};
request.end();
request.on( 'error', fail );
request.on( 'response', function (response) {
response.setEncoding('utf8');
response.on( 'error', fail );
response.on( 'data', function (chunk) {
if (chunk) body += chunk;
} );
response.on( 'end', function () {
try {
if (body) return success(JSON.parse(body));
else fail();
}
catch(e) {
fail();
}
} );
} );
try {
http.get( {
host : origin,
port : ssl ? 443 : 80,
path : url
}, function(response) {
response.setEncoding('utf8');
response.on( 'error', fail );
response.on( 'data', function (chunk) {
if (chunk) body += chunk;
} );
response.on( 'end', function () {
try {
if (body) return success(JSON.parse(body));
else fail();
} catch(e) { fail(); }
} );
}).on( 'error', fail );
} catch(e) { fail(); }
}

@@ -138,0 +137,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