diff --git a/index.js b/index.js index 37a1515c9a20ccea0eb127b464faf1bcbb4b6757..e26f7425e4a94450c883e332cf5c79f646044682 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ const querystring = require('querystring'); let getFormData = (req)=>{ return new Promise((resolve,reject)=>{ - if (req.method === 'POST' && req.headers['content-type'] === 'application/x-www-form-urlencoded') { + if (req.method === 'POST' && /application\/x\-www\-form\-urlencoded/.test(req.headers['content-type'])) { let body = ''; // 监听 data 事件,接收数据块