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

node-ral

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ral - npm Package Compare versions

Comparing version 0.0.38 to 0.0.39

27

lib/ext/protocol/httpProtocol.js

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

var urlencode = require('urlencode');
var zlib = require('zlib');

@@ -29,2 +30,5 @@ function HttpProtocol() {

config = Protocol.normalizeConfig(config);
if (config.disableGzip === undefined) {
config.disableGzip = true;
}
if (typeof config.query !== 'object') {

@@ -54,2 +58,9 @@ config.query = urlencode.parse(config.query, {

}
if (config.disableGzip) {
if (config.headers && config.headers['accept-encoding']) {
config.headers['accept-encoding'] = '';
}
}
var opt = {

@@ -64,3 +75,2 @@ host: config.server.host,

};
var request;

@@ -83,5 +93,18 @@

}
res.pipe(response);
// 添加 gzip与deflate 处理
switch (config.headers ? res.headers['content-encoding'] : '') {
// or, just use zlib.createUnzip() to handle both cases
case 'gzip':
res.pipe(zlib.createGunzip()).pipe(response);
break;
case 'deflate':
res.pipe(zlib.createInflate()).pipe(response);
break;
default:
res.pipe(response);
break;
}
callback && callback(response);
});
if (config.payload) {

@@ -88,0 +111,0 @@ req.write(config.payload);

2

package.json
{
"name": "node-ral",
"version": "0.0.38",
"version": "0.0.39",
"description": "a rpc client for node",

@@ -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