Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion task-sdk/src/airflow/sdk/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,9 @@ def _update_auth(self, response: httpx.Response):
def request(self, *args, **kwargs):
"""Implement a convenience for httpx.Client.request with a retry layer."""
# Set content type as convenience if not already set
if "content" in kwargs and "headers" not in kwargs:
if kwargs.get("content", None) is not None and "content-type" not in (
kwargs.get("headers", {}) or {}
):
kwargs["headers"] = {"content-type": "application/json"}

return super().request(*args, **kwargs)
Expand Down