Skip to content

Commit 37c3ddd

Browse files
authored
Use the parsed request body rather than ctx.body, as ctx.body represents the response body.
1 parent 21aebc7 commit 37c3ddd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/use/koa.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ export function createHandler<Context extends OperationContext = undefined>(
120120
method: ctx.method,
121121
headers: ctx.headers,
122122
body: () => {
123-
if (ctx.body) {
123+
if (ctx.request.body) {
124124
// in case koa has a body parser
125-
return ctx.body;
125+
return ctx.request.body as any;
126126
}
127127
return new Promise<string>((resolve) => {
128128
let body = '';

0 commit comments

Comments
 (0)