Comparing version 0.3.0 to 0.3.1
ChangeLog | ||
========= | ||
0.3.1 (2017-04-26) | ||
------------------ | ||
* #31: Support for setting a standard `Content-Type` HTTP header. | ||
0.3.0 (2017-04-24) | ||
@@ -5,0 +11,0 @@ ------------------ |
@@ -19,2 +19,7 @@ var url = require('url'); | ||
} | ||
if (options.contentType) { | ||
this.contentType = options.contentType; | ||
} else { | ||
this.contentType = 'application/hal+json'; | ||
} | ||
@@ -121,2 +126,5 @@ if (options.auth) { | ||
} | ||
if (!request.headers.has('Content-Type')) { | ||
request.headers.set('Content-Type', this.contentType); | ||
} | ||
if (!request.headers.has('Authorization') && this.auth) { | ||
@@ -123,0 +131,0 @@ switch(this.auth.type) { |
{ | ||
"name": "restl", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Opiniated HAL client.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -137,2 +137,4 @@ Restl - A hypermedia client for nodejs | ||
format as the HTTP header. | ||
* `contentType` the default contentType the client sends over. By default | ||
this is `application/hal+json`. | ||
@@ -139,0 +141,0 @@ |
@@ -28,2 +28,3 @@ const Client = require('../../lib/client'); | ||
expect(result['accept']).to.eql('application/hal+json, application/json'); | ||
expect(result['content-type']).to.eql('application/hal+json'); | ||
@@ -30,0 +31,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
39729
925
331