fix http block bug (#4261)
This commit is contained in:
@@ -58,7 +58,7 @@ async def aiohttp_request(
|
|||||||
# Handle body based on content type and method
|
# Handle body based on content type and method
|
||||||
if method.upper() != "GET":
|
if method.upper() != "GET":
|
||||||
# If files are provided, use multipart/form-data
|
# If files are provided, use multipart/form-data
|
||||||
if files is not None:
|
if files:
|
||||||
form = aiohttp.FormData()
|
form = aiohttp.FormData()
|
||||||
|
|
||||||
# Add files to form
|
# Add files to form
|
||||||
|
|||||||
@@ -3916,7 +3916,7 @@ class HttpRequestBlock(Block):
|
|||||||
|
|
||||||
# If files are provided, don't set default Content-Type (aiohttp will set multipart/form-data)
|
# If files are provided, don't set default Content-Type (aiohttp will set multipart/form-data)
|
||||||
if not self.files:
|
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)
|
LOG.info("Adding default content-type as application/json", headers=self.headers)
|
||||||
self.headers["Content-Type"] = "application/json"
|
self.headers["Content-Type"] = "application/json"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user