Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
conditional form boundry for form-data
  • Loading branch information
casserni committed Jan 20, 2018
commit ded6d7652feda7882c4a8da382fc43478b8d2434
12 changes: 9 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ HTTPSnippet.prototype.prepare = function(request) {
);
}

request.postData.boundary = form.getBoundary();
request.headersObj["content-type"] =
"multipart/form-data; boundary=" + form.getBoundary();
request.headersObj["content-type"] = "multipart/form-data;";

if (form.getBoundary) {
request.postData.boundary = form.getBoundary();

request.headersObj["content-type"] =
"multipart/form-data; boundary=" +
(request.postData.boundary || "");
}
}
break;

Expand Down