Skip to content

Commit

Permalink
feat: support mime type text/json
Browse files Browse the repository at this point in the history
  • Loading branch information
tickli authored and RobinzZH committed Oct 15, 2019
1 parent 397469e commit 82a3375
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/proxy/http.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ function doRoute(req, res) {
contentType.indexOf('application/x-www-form-urlencoded') > -1
|| contentType.indexOf('text/plain') > -1
|| contentType.indexOf('application/json') > -1
|| contentType.indexOf('text/json') > -1
) {
parseBody(req, res, function() {
return modulePathHandler();
Expand Down
2 changes: 1 addition & 1 deletion bin/tsw/util/http/parseBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = function(req, res, next) {
}

req.body = req.POST;
} else if (contentType.indexOf('application/json') > -1) {
} else if (contentType.indexOf('application/json') > -1 || contentType.indexOf('text/json') > -1 ) {

try {
req.POST = JSON.parse(req.REQUEST.body);
Expand Down

0 comments on commit 82a3375

Please sign in to comment.