Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BlackPearl
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
BlackPearl
Commits
d45c3ee6
Commit
d45c3ee6
authored
Nov 06, 2017
by
tywldx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
72a4df51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
index.js
middleware/body/index.js
+4
-1
No files found.
middleware/body/index.js
View file @
d45c3ee6
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment