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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188434
2938
Updatedhawk@~0.10.2
Updatedqs@~0.5.4