fix http block bug (#4261)

This commit is contained in:
LawyZheng
2025-12-11 03:01:03 +08:00
committed by GitHub
parent 2be36c7738
commit 0b617f6635
2 changed files with 2 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ async def aiohttp_request(
# Handle body based on content type and method
if method.upper() != "GET":
# If files are provided, use multipart/form-data
if files is not None:
if files:
form = aiohttp.FormData()
# Add files to form

View File

@@ -3916,7 +3916,7 @@ class HttpRequestBlock(Block):
# If files are provided, don't set default Content-Type (aiohttp will set multipart/form-data)
if not self.files:
if not self.headers.get("Content-Type") or not self.headers.get("content-type"):
if not self.headers.get("Content-Type") and not self.headers.get("content-type"):
LOG.info("Adding default content-type as application/json", headers=self.headers)
self.headers["Content-Type"] = "application/json"