Skip to content

Commit 11e2136

Browse files
committed
update comment
1 parent 815d25e commit 11e2136

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • packages/http-client-python/generator/pygen/codegen/templates

packages/http-client-python/generator/pygen/codegen/templates/utils.py.jinja2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) ->
102102
filename = os.path.basename(name_attr)
103103
if not filename:
104104
filename = f"{field_name}_{index}" if index else field_name
105+
106+
# Return a 3-tuple with an explicit "application/octet-stream" content type.
107+
# A 2-tuple (filename, content) would leave the part's Content-Type unset, and
108+
# the sdk core library only defaults to "application/octet-stream" for bare
109+
# (non-tuple) values - a tuple bypasses that default and falls back to the
110+
# HTTP "text/plain" default instead. Setting it explicitly preserves the
111+
# pre-existing behavior for bare bytes/IO across all transports.
105112
return (filename, entry, "application/octet-stream")
106113

107114
def prepare_multipart_form_data(

0 commit comments

Comments
 (0)