fix(http): force multipart/form-data even without files(#20322) (#20323)

This commit is contained in:
teawoong Kim
2025-05-28 18:04:38 +09:00
committed by GitHub
parent b39ca7ee31
commit 400ae664bb
2 changed files with 11 additions and 2 deletions

View File

@@ -246,7 +246,9 @@ def test_executor_with_form_data():
assert "multipart/form-data" in executor.headers["Content-Type"]
assert executor.params == []
assert executor.json is None
assert executor.files is None
# '__multipart_placeholder__' is expected when no file inputs exist,
# to ensure the request is treated as multipart/form-data by the backend.
assert executor.files == [("__multipart_placeholder__", ("", b"", "application/octet-stream"))]
assert executor.content is None
# Check that the form data is correctly loaded in executor.data