mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 23:22:22 +00:00
@@ -3,6 +3,7 @@ import { loadOpenAPISchemaFromUrl } from '@fastgpt/global/common/string/swagger'
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||
import { isInternalAddress } from '@fastgpt/service/common/system/utils';
|
||||
import { authCert } from '@fastgpt/service/support/permission/auth/common';
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
const apiURL = req.body.url as string;
|
||||
@@ -11,6 +12,8 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
return Promise.reject(CommonErrEnum.missingParams);
|
||||
}
|
||||
|
||||
await authCert({ req, authToken: true });
|
||||
|
||||
const isInternal = isInternalAddress(apiURL);
|
||||
|
||||
if (isInternal) {
|
||||
|
Reference in New Issue
Block a user