Skip to content

Commit

Permalink
feat: use binary formatting by default with exception of textual mime…
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
bobvanderlinden committed Aug 31, 2020
1 parent 2c890ad commit bc058a3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/node-conversion.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,16 @@ function isBinaryMimeType(mimeType) {
if (/^text\//.test(mimeType)) {
return false;
}
if (/^image\//.test(mimeType)) {
return true;
if (/^application\/json(\W|$)/.test(mimeType)) {
return false;
}
if (/^application\/octet-stream/.test(mimeType)) {
return true;
if (/^application\/xml(;|\+|$)/.test(mimeType)) {
return false;
}
if (/^application\/x-www-form-urlencoded/.test(mimeType)) {
return false;
}
if (/^multipart\//.test(mimeType)) {
return true;
}
return false;
return true;
}

async function getPostDataFromNodeRequest(nodeRequest) {
Expand Down

0 comments on commit bc058a3

Please sign in to comment.