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

minreq

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minreq - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

30

index.js

@@ -202,2 +202,8 @@ var http = require("http"),

if(this._options.headers){
for(var header in this._options.headers){
this._request.setHeader(header, this._options.headers[header]);
}
}
if(!("timeout" in options) || options.timeout){

@@ -234,3 +240,27 @@ this._reqTimeout = setTimeout(function(){

};
Request.prototype.setHeader = function(name, value){
if(arguments.length < 2) throw Error("wrong number of arguments");
if(this._request){
return this._request.setHeader(name, value);
}
if(typeof this._options.headers !== "object"){
this._options.headers = {__proto__: null};
}
this._options.headers[name.toLowerCase()] = value;
};
Request.prototype.getHeader = function(name){
if(arguments.length < 1) throw Error("wrong number of arguments");
if(this._request){
return this._request.getHeader(name);
}
return this._options.headers && this._options.headers[name.toLowerCase()];
};
Request.prototype.removeHeader = function(name){
if(arguments.length < 1) throw Error("wrong number of arguments");
if(this._request){
return this._request.removeHeader(name);
}
return this._options.headers && delete this._options.headers[name.toLowerCase()];
};
module.exports.Request = Request;

2

package.json
{
"name": "minreq",
"version": "0.1.4",
"version": "0.1.5",
"description": "minimalistic request library",

@@ -5,0 +5,0 @@ "author": "Felix Boehm <me@feedic.com>",

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