fix: missing boundary in multipart/form-data error
This commit is contained in:
parent
3467ad3d02
commit
c6bebc8157
@ -212,6 +212,12 @@ class ApiTool(Tool):
|
|||||||
else:
|
else:
|
||||||
body = body
|
body = body
|
||||||
|
|
||||||
|
# if there is a file upload, remove the Content-Type header so that httpx can automatically generate the boundary header required for multipart/form-data.
|
||||||
|
# issue: https://github.com/langgenius/dify/issues/13684
|
||||||
|
# reference: https://stackoverflow.com/questions/39280438/fetch-missing-boundary-in-multipart-form-data-post
|
||||||
|
if files:
|
||||||
|
headers.pop("Content-Type", None)
|
||||||
|
|
||||||
if method in {
|
if method in {
|
||||||
"get",
|
"get",
|
||||||
"head",
|
"head",
|
||||||
|
Loading…
Reference in New Issue
Block a user