Skip to content

Commit

Permalink
Allowing empty data for specific endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed Sep 8, 2017
1 parent a4bf853 commit e15cbfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ Modem.prototype.dial = function(options, callback) {
optionsf.headers['Content-Type'] = 'application/tar';
} else if (opts && options.method === 'POST') {
data = JSON.stringify(opts._body || opts);
if (data !== '{}' && data !== '""') {
if(options.allowEmpty) {
optionsf.headers['Content-Type'] = 'application/json';
} else {
data = undefined;
if (data !== '{}' && data !== '""') {
optionsf.headers['Content-Type'] = 'application/json';
} else {
data = undefined;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docker-modem",
"description": "Docker remote API network layer module.",
"version": "1.0.1",
"version": "1.0.2",
"author": "Pedro Dias <[email protected]>",
"maintainers": [
"apocas <[email protected]>"
Expand Down

0 comments on commit e15cbfe

Please sign in to comment.