ampersand-sync
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -7,2 +7,3 @@ /*$AMPERSAND_VERSION*/ | ||
var qs = require('qs'); | ||
var mediaType = require('media-type'); | ||
@@ -131,3 +132,5 @@ | ||
// Parse body as JSON | ||
if (typeof body === 'string' && (!params.headers.accept || params.headers.accept.indexOf('application/json')===0)) { | ||
var accept = mediaType.fromString(params.headers.accept); | ||
var parseJson = accept.isValid() && accept.type === 'application' && (accept.subtype === 'json' || accept.suffix === 'json'); | ||
if (typeof body === 'string' && (!params.headers.accept || parseJson)) { | ||
try { | ||
@@ -134,0 +137,0 @@ body = JSON.parse(body); |
{ | ||
"name": "ampersand-sync", | ||
"description": "Provides sync behavior for updating data from ampersand models and collections to the server.", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -24,2 +24,3 @@ "files": [ | ||
"lodash.result": "^3.0.0", | ||
"media-type": "0.3.0", | ||
"qs": "^4.0.0", | ||
@@ -26,0 +27,0 @@ "request": "^2.55.0", |
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
14488
134
9
+ Addedmedia-type@0.3.0
+ Addedmedia-type@0.3.0(transitive)