mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: ignore body not exist for post op
This commit is contained in:
1 parent
b5bea63eed
commit
0af7299c31
1 file changed
+1
-1
@@ -228,7 +228,7 @@ async function handle(ctx: KoaContext, HandlerClass, checker) {
|
||||
ctx.handler = h;
|
||||
try {
|
||||
const method = ctx.method.toLowerCase();
|
||||
const operation = (method === 'post' && ctx.request.body.operation)
|
||||
const operation = (method === 'post' && ctx.request.body?.operation)
|
||||
? `_${ctx.request.body.operation}`.replace(/_([a-z])/gm, (s) => s[1].toUpperCase())
|
||||
: '';
|
||||
|
||||
|
||||
Reference in new issue
Block a user