Socket
Socket
Sign inDemoInstall

request

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request - npm Package Compare versions

Comparing version 2.16.2 to 2.16.4

12

index.js

@@ -966,11 +966,17 @@ // Copyright 2010-2012 Mikeal Rogers

Request.prototype.json = function (val) {
this.setHeader('accept', 'application/json')
var self = this;
var setAcceptHeader = function() {
if (!self.headers['accept'] && !self.headers['Accept']) {
self.setHeader('accept', 'application/json')
}
}
setAcceptHeader();
this._json = true
if (typeof val === 'boolean') {
if (typeof this.body === 'object') {
this.setHeader('content-type', 'application/json')
setAcceptHeader();
this.body = safeStringify(this.body)
}
} else {
this.setHeader('content-type', 'application/json')
setAcceptHeader();
this.body = safeStringify(val)

@@ -977,0 +983,0 @@ }

@@ -10,3 +10,3 @@ {

],
"version": "2.16.2",
"version": "2.16.4",
"author": "Mikeal Rogers <mikeal.rogers@gmail.com>",

@@ -21,3 +21,3 @@ "repository": {

"engines": [
"node >= 0.3.6"
"node >= 0.8.0"
],

@@ -28,3 +28,3 @@ "main": "index.js",

"mime": "~1.2.7",
"hawk": "~0.10.0",
"hawk": "~0.10.2",
"node-uuid": "~1.4.0",

@@ -37,3 +37,3 @@ "cookie-jar": "~0.2.0",

"json-stringify-safe": "~3.0.0",
"qs": "~0.5.0"
"qs": "~0.5.4"
},

@@ -40,0 +40,0 @@ "scripts": {

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