Comparing version 6.7.1 to 6.8.0
@@ -446,3 +446,3 @@ /*global unescape, btoa, atob, JSON*/ | ||
result += '\r\n'; | ||
if (this.body && typeof this.body === 'object' && isNonBufferNonRegExpObject(this.body) && /^application\/json\b|\+json/i.test(this.headers.get('Content-Type'))) { | ||
if (this.body && typeof this.body === 'object' && isNonBufferNonRegExpObject(this.body)) { | ||
result += JSON.stringify(this.body); | ||
@@ -449,0 +449,0 @@ } else { |
{ | ||
"name": "messy", | ||
"version": "6.7.1", | ||
"version": "6.8.0", | ||
"description": "Object model for HTTP and RFC822 messages", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -888,2 +888,17 @@ /*global describe, it*/ | ||
}); | ||
it('should support passing a JSON body as an object despite a non-JSON Content-Type', function () { | ||
expect(new Message({ | ||
headers: { | ||
'Content-Type': 'application/octet-stream' | ||
}, | ||
body: { | ||
foo: 123 | ||
} | ||
}).toString(), 'to equal', | ||
'Content-Type: application/octet-stream\r\n' + | ||
'\r\n' + | ||
'{"foo":123}' | ||
); | ||
}); | ||
}); |
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
173496
3658