Skip to content

Commit d8bb922

Browse files
committed
🐛 fix: fix request error
1 parent 3bb29a0 commit d8bb922

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api/v1/runner.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { OpenAIPluginPayload } from '../../types/plugins';
33
export const runtime = 'edge';
44

55
export default async (req: Request) => {
6+
if (req.method !== 'POST') return new Response('Method Not Allowed', { status: 405 });
7+
68
const { name, arguments: args } = (await req.json()) as OpenAIPluginPayload;
79

810
console.log(`检测到 functionCall: ${name}`);

0 commit comments

Comments
 (0)