New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lightning-request-net

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightning-request-net - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

package.json
{
"name": "lightning-request-net",
"version": "0.2.1",
"version": "0.2.2",
"description": "Lightweight Node.js HTTP client based on net.",

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

@@ -6,3 +6,3 @@ const CRLF = '\r\n';

module.exports = {
encode: function(options) {
encode: function (options) {
options.headers = options.headers || {};

@@ -16,3 +16,3 @@ const chunkedEncoding = options.headers['Transfer-Encoding'] === 'chunked';

let data = `${options.method} ${options.path} HTTP/1.1${CRLF}`;
Object.keys(options.headers).forEach(key => {
Object.keys(options.headers).forEach((key) => {
data += `${key}: ${options.headers[key]}${CRLF}`;

@@ -36,3 +36,3 @@ });

decode: function(data) {
decode: function (data) {
const idx = data.indexOf(CRLF);

@@ -51,5 +51,10 @@ const idx2 = data.indexOf(CRLF_2);

let headers = {};
responseHeadersText.split(CRLF).forEach(item => {
responseHeadersText.split(CRLF).forEach((item) => {
const index = item.indexOf(': ');
headers[item.slice(0, index)] = item.slice(index + 2);
const key = item.slice(0, index).toLowerCase();
if (headers[key]) {
headers[key] = headers[key] + ', ' + item.slice(index + 2);
} else {
headers[key] = item.slice(index + 2);
}
});

@@ -56,0 +61,0 @@ if (headers['Transfer-Encoding']) {

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