Commit d45c3ee6 authored by tywldx's avatar tywldx

debug

parent 72a4df51
......@@ -5,7 +5,7 @@ var copy = require('copy-to');
module.exports = function(opts) {
opts = opts || {};
console.log("=====???>>>>")
// enable types
var enableTypes = opts.enableTypes || ['json', 'form'];
var enableForm = checkEnable(enableTypes, 'form');
......@@ -52,6 +52,7 @@ module.exports = function(opts) {
if (ctx.request.body !== undefined) return await next();
try {
console.log("----------???")
ctx.request.body = await parseBody(ctx);
} catch (err) {
if (onerror) {
......@@ -64,6 +65,8 @@ module.exports = function(opts) {
};
async function parseBody(ctx) {
console.log("-----------------")
console.log(ctx.request.is(formTypes))
if (enableJson && ctx.request.is(jsonTypes)) {
return await parse.json(ctx, jsonOpts);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment