Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

Commit

Permalink
Merge d414e89 into 2938940
Browse files Browse the repository at this point in the history
  • Loading branch information
fvj committed Jun 15, 2017
2 parents 2938940 + d414e89 commit e41b78b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/index.js
Expand Up @@ -45,7 +45,11 @@ export default (options = {
request.body = result
} else if (options.json &&
['application/json', 'text/json'].includes(type)) {
request.body = JSON.parse(raw)
try {
request.body = JSON.parse(raw)
} catch (error) {
request.body = ''
}
} else {
request.body = raw
}
Expand Down

0 comments on commit e41b78b

Please sign in to comment.