mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-05 01:02:59 +08:00
Fix share (#6554)
* fix: http tool * fix: http tool * fix: test * fix: test * fix: test * fix: test
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { isInternalAddress } from '../../../../../../../common/system/utils';
|
||||
import { isInternalAddress, PRIVATE_URL_TEXT } from '../../../../../../../common/system/utils';
|
||||
import axios from 'axios';
|
||||
import { serverRequestBaseUrl } from '../../../../../../../common/api/serverRequest';
|
||||
import { parseFileExtensionFromUrl } from '@fastgpt/global/common/string/tools';
|
||||
@@ -59,7 +59,7 @@ export const dispatchFileRead = async ({
|
||||
return {
|
||||
index,
|
||||
name: '',
|
||||
content: Promise.reject('Url is invalid')
|
||||
content: Promise.reject(PRIVATE_URL_TEXT)
|
||||
};
|
||||
}
|
||||
// Get file buffer data
|
||||
|
||||
@@ -26,7 +26,7 @@ import type { StoreSecretValueType } from '@fastgpt/global/common/secret/type';
|
||||
import { getLogger, LogCategories } from '../../../../common/logger';
|
||||
import { SERVICE_LOCAL_HOST } from '../../../../common/system/tools';
|
||||
import { formatHttpError } from '../utils';
|
||||
import { isInternalAddress } from '../../../../common/system/utils';
|
||||
import { isInternalAddress, PRIVATE_URL_TEXT } from '../../../../common/system/utils';
|
||||
import { serviceRequestMaxContentLength } from '../../../../common/system/constants';
|
||||
import { axios } from '../../../../common/api/axios';
|
||||
|
||||
@@ -496,7 +496,7 @@ async function fetchData({
|
||||
timeout: number;
|
||||
}) {
|
||||
if (await isInternalAddress(url)) {
|
||||
return Promise.reject('Url is invalid');
|
||||
return Promise.reject(PRIVATE_URL_TEXT);
|
||||
}
|
||||
|
||||
const { data: response } = await axios({
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ChatRoleEnum } from '@fastgpt/global/core/chat/constants';
|
||||
import { type ChatItemType } from '@fastgpt/global/core/chat/type';
|
||||
import { addDays } from 'date-fns';
|
||||
import { getNodeErrResponse } from '../utils';
|
||||
import { isInternalAddress } from '../../../../common/system/utils';
|
||||
import { isInternalAddress, PRIVATE_URL_TEXT } from '../../../../common/system/utils';
|
||||
import { replaceS3KeyToPreviewUrl } from '../../../dataset/utils';
|
||||
import { getFileS3Key } from '../../../../common/s3/utils';
|
||||
import { S3ChatSource } from '../../../../common/s3/sources/chat';
|
||||
@@ -188,7 +188,7 @@ export const getFileContentFromLinks = async ({
|
||||
|
||||
try {
|
||||
if (await isInternalAddress(url)) {
|
||||
return Promise.reject('Url is invalid');
|
||||
return Promise.reject(PRIVATE_URL_TEXT);
|
||||
}
|
||||
|
||||
// Get file buffer data
|
||||
|
||||
Reference in New Issue
Block a user