mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
feat(http): text/plain is allowed (#2376)
* feat(http): plan/txt is allowed * Update http468.ts * Update http468.ts * body 添加string类型
This commit is contained in:
@@ -130,7 +130,7 @@ export type DispatchNodeResponseType = {
|
||||
|
||||
// http
|
||||
params?: Record<string, any>;
|
||||
body?: Record<string, any>;
|
||||
body?: Record<string, any> | string;
|
||||
headers?: Record<string, any>;
|
||||
httpResult?: Record<string, any>;
|
||||
|
||||
|
@@ -111,6 +111,9 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
||||
if (!httpJsonBody) return {};
|
||||
try {
|
||||
httpJsonBody = replaceVariable(httpJsonBody, allVariables);
|
||||
if (headers['Content-Type']?.includes('text/plain')) {
|
||||
return httpJsonBody?.replaceAll(UNDEFINED_SIGN, 'null');
|
||||
}
|
||||
const jsonParse = JSON.parse(httpJsonBody);
|
||||
const removeSignJson = removeUndefinedSign(jsonParse);
|
||||
return removeSignJson;
|
||||
@@ -196,7 +199,7 @@ async function fetchData({
|
||||
method: string;
|
||||
url: string;
|
||||
headers: Record<string, any>;
|
||||
body: Record<string, any>;
|
||||
body: Record<string, any> | string;
|
||||
params: Record<string, any>;
|
||||
}) {
|
||||
const { data: response } = await axios({
|
||||
|
Reference in New Issue
Block a user