Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
8273c96b
authored
Oct 10, 2024
by
heheer
Committed by
GitHub
Oct 10, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: form-data not display in http node log (#2868)
* fix: fix form-data not display in http node log * fix
parent
61c6b1e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
packages/service/core/workflow/dispatch/tools/http468.ts
+17
-2
No files found.
packages/service/core/workflow/dispatch/tools/http468.ts
View file @
8273c96b
...
...
@@ -184,6 +184,21 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
}
})();
const
formattedRequestBody
:
Record
<
string
,
any
>
=
(()
=>
{
if
(
requestBody
instanceof
FormData
||
requestBody
instanceof
URLSearchParams
)
{
return
Object
.
fromEntries
(
requestBody
);
}
else
if
(
typeof
requestBody
===
'string'
)
{
try
{
return
JSON
.
parse
(
requestBody
);
}
catch
{
return
{
content
:
requestBody
};
}
}
else
if
(
typeof
requestBody
===
'object'
&&
requestBody
!==
null
)
{
return
requestBody
;
}
return
{};
})();
try
{
const
{
formatResponse
,
rawResponse
}
=
await
(
async
()
=>
{
const
systemPluginCb
=
await
getSystemPluginCb
();
...
...
@@ -225,7 +240,7 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
[
DispatchNodeResponseKeyEnum
.
nodeResponse
]:
{
totalPoints
:
0
,
params
:
Object
.
keys
(
params
).
length
>
0
?
params
:
undefined
,
body
:
Object
.
keys
(
requestBody
).
length
>
0
?
r
equestBody
:
undefined
,
body
:
Object
.
keys
(
formattedRequestBody
).
length
>
0
?
formattedR
equestBody
:
undefined
,
headers
:
Object
.
keys
(
headers
).
length
>
0
?
headers
:
undefined
,
httpResult
:
rawResponse
},
...
...
@@ -241,7 +256,7 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
[
NodeOutputKeyEnum
.
error
]:
formatHttpError
(
error
),
[
DispatchNodeResponseKeyEnum
.
nodeResponse
]:
{
params
:
Object
.
keys
(
params
).
length
>
0
?
params
:
undefined
,
body
:
Object
.
keys
(
requestBody
).
length
>
0
?
r
equestBody
:
undefined
,
body
:
Object
.
keys
(
formattedRequestBody
).
length
>
0
?
formattedR
equestBody
:
undefined
,
headers
:
Object
.
keys
(
headers
).
length
>
0
?
headers
:
undefined
,
httpResult
:
{
error
:
formatHttpError
(
error
)
}
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment