Add handling for Content-Type header in AppClients
This commit modifies the AppClients class to remove the Content-Type header if it is explicitly set to None, particularly for file uploads. This change enhances the robustness of the async code by ensuring proper header management during API requests, aligning with the project's focus on well-documented and maintainable code.
This commit is contained in:
parent
2543b2103b
commit
7b5589653a
1 changed files with 4 additions and 0 deletions
|
|
@ -322,6 +322,10 @@ class AppClients:
|
|||
existing_headers = kwargs.pop("headers", {})
|
||||
headers = {**default_headers, **existing_headers}
|
||||
|
||||
# Remove Content-Type if explicitly set to None (for file uploads)
|
||||
if headers.get("Content-Type") is None:
|
||||
headers.pop("Content-Type", None)
|
||||
|
||||
url = f"{LANGFLOW_URL}{endpoint}"
|
||||
|
||||
return await self.langflow_http_client.request(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue